tiktok-scraper icon indicating copy to clipboard operation
tiktok-scraper copied to clipboard

"Unexpected end of JSON input" When trying to get all videos from a user ...

Open palmthree-studio opened this issue 2 years ago • 8 comments

Hello,

I've tried anything that I can, but I am never able to get all videos from a user ...

I always have this error : invalid json response body at https://api2.musical.ly/aweme/v1/aweme/detail/?aweme_id=7144372530571267333 reason: Unexpected end of JSON input. type: 'invalid-json';

This is my code :

app.get('/getAllVideos', async (req, res) => {
  var username = "exclutele";
  const videos = await tiktokscraper.getAllVideosFromUser(username,true);
  res.send(videos);
  console.log(videos);
});

Can you help me to figure it out ?

Thanks !

palmthree-studio avatar Sep 18 '22 12:09 palmthree-studio

@palmthree-studio for what it's worth, I'm getting the same thing getting video info...

weisensee avatar Oct 17 '22 19:10 weisensee

Hey @palmthree-studio and @weisensee, You are getting this error because the api which is used by the library to fetch the videos without watermark is down. I have been looking for alternatives for some time now. Will be fixed soon 🤘🏼

naseif avatar Oct 22 '22 18:10 naseif

If the api is only down to download the videos without watermark, is there maybe a way to get the videos with watermark? I am only interested in the data from the videos of a user. I don't need the videos themselves. Is there any way to customize the repository somewhere so you can use that for this?

simmison avatar Nov 10 '22 14:11 simmison

@naseif I also get the invalid json response. The reason is your fetch for https://m.tiktok.com/api/post/item_list/... returns empty string which then cannot be deserialized into valid JSON. I don't know the reason is started returning empty string but is there an alternative?

jpaladin avatar Nov 29 '22 19:11 jpaladin

Same error for python implementations https://github.com/davidteather/TikTok-Api/issues/974

jpaladin avatar Dec 14 '22 19:12 jpaladin

Fixed in 6a8bea4a7f537d324610663aad90bff8e87bf2be, Please update the library to the latest version

naseif avatar Jan 26 '23 16:01 naseif

Fixed in 6a8bea4, Please update the library to the latest version

looks like the issue's back, using 1.4.1

horsaen avatar Feb 12 '23 05:02 horsaen

I'm still having the same issue, also using 1.4.1.

mikebg95 avatar Sep 06 '23 08:09 mikebg95