tiktok-scraper
tiktok-scraper copied to clipboard
"Unexpected end of JSON input" When trying to get all videos from a user ...
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 for what it's worth, I'm getting the same thing getting video info...
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 🤘🏼
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?
@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?
Same error for python implementations https://github.com/davidteather/TikTok-Api/issues/974
Fixed in 6a8bea4a7f537d324610663aad90bff8e87bf2be, Please update the library to the latest version
Fixed in 6a8bea4, Please update the library to the latest version
looks like the issue's back, using 1.4.1
I'm still having the same issue, also using 1.4.1.