Created
August 27, 2025 21:33
-
-
Save adrianhorning08/e51adde4ffb9882c877b3b0c650ebd96 to your computer and use it in GitHub Desktop.
TikTok stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function fetchAndEncodeImage(url) { | |
| const response = await axios.get(url, { responseType: "arraybuffer" }); | |
| return Buffer.from(response.data, "binary").toString("base64"); | |
| } | |
| async function solveCaptcha(puzzleImageUrl, pieceImageUrl) { | |
| try { | |
| const puzzleBase64 = await fetchAndEncodeImage(puzzleImageUrl); | |
| const pieceBase64 = await fetchAndEncodeImage(pieceImageUrl); | |
| const payload = { | |
| puzzleImageB64: puzzleBase64, | |
| pieceImageB64: pieceBase64, | |
| }; | |
| const response = await axios.post( | |
| `${BASE_URL}/puzzle?licenseKey=${LICENSE_KEY}`, | |
| payload | |
| ); | |
| return response.data; | |
| } catch (error) { | |
| console.error("Error:", error.response?.data || error.message); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment