tiktok-downloader: Error: SyntaxError: Unexpected end of JSON input

Describe the bug I get an error when downloading a single video.

[*] URL: https://www.tiktok.com/@.....
Error: SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at getVideo (/home/tbm/src/tiktok-downloader/index.js:126:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/tbm/src/tiktok-downloader/index.js:320:20
Response body: 
/home/tbm/src/tiktok-downloader/index.js:133
    if (res.aweme_list[0].aweme_id != idVideo) {
            ^

TypeError: Cannot read properties of undefined (reading 'aweme_list')
    at getVideo (/home/tbm/src/tiktok-downloader/index.js:133:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/tbm/src/tiktok-downloader/index.js:320:20

Node.js v18.19.0

I get this error when downloading a video: Single download, without watermark.

It happens on every single video I tried. It was working fine a few days ago.

Can you reproduce this issue?

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 26 (7 by maintainers)

Most upvoted comments

@DD7-13 This fix worked but how did you know to change that line?

I don’t know, actually. I just tried to change the server name and it worked. After that I tried a few other possible names, but no luck