-
-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Example return "TikTok returned an empty response" for user.videos #1179
Comments
This happens to me as well when I run in headless mode, if I set headless to false it works perfectly fine. |
It doesn't work for me. |
I have same issue with this, I just copy the content of https://github.com/davidteather/TikTok-Api/blob/main/examples/user_example.py file and run in my local, and it thrown me the my local file:
I don't know what happening. My stacktrace:
|
This API works in some network environments but does not work in others. |
how to fix it |
@davidteather really need help with this bug |
Seems like it is working after I change my IPs. Is it related to proxies, idk. |
@arhen You mean you changed your machines physical address or just a proxy of any type? Fetching accounts videos worked super fine for me, until last week where it started throwing the error. I was using TikTokApi 6.2.0 version the whole time |
it still not working for me |
@Gereks123 @zakrian07 did anyone find the answer? |
@Gereks123 No, just changes my computer public ips |
I tried with multiple different IPs, but it doesn't work - even thought it worked fine before. It there anything we can do to find the cause for this? |
Hey, |
Okay short update:
below |
Woaaah, It works!!!!!!! can you explain your POV why thats problem occurs and why the solution above resolve the problem. |
@davidteather thisi s a blocker issue need fix it really need your input as my tool is down from coupe of weeks now |
Hey, i guess it's some security "feature" from tiktok against bots. My first try was page scrolling but this doesn't work. |
It could be the bot's detection system. I'm not entirely sure how it works but maybe if no action has happened within a small timeframe it's automatically detected as a bot?? It could be the playwright itself, maybe TikTok detects some patterns that resemble the bots behaviour and automatically denies access? Also, the |
I think someone need to make a PR for this. @xXZaretXx |
@arhen yes, but i hope somebody would improve my little "hacky" workaround. 😅 |
Bring @davidteather here TLDR; With default interactions, I got blocked and can access the video again after several hours or even days. From @xXZaretXx |
Can confirm on my side, I'm scraping around 100+ accounts daily and this workaround fixed the problem for me. EDIT: wording |
Everyone on this thread, maybe check out this as well! #1090 I'm running version 6.2.0 for the TikTokAPI with Playwright version is 1.43.0. ALSO, check your msTokens, they expire at a certain time and I had an incident one time where my code was not working due to the expired msToken. The API itself sometimes has issues with fetching the token from the browser itself. Create an array of msTokens and just feed it to the
|
@Warhead007 maybe you need to update your ms_token |
Hi @xXZaretXx , I using a chromium. And can you explain how to get and update a ms_token? I'm a new to this project. Thank you. |
You can get the ms_token by going to your actual browser and then navigate to tiktoks actual page. Then open your developer tools and look for a cookie named ms_Token or something like that. Also, looking at the picture, when you create your tiktok session, use the parameter "headless=False" |
Hi, @Gereks123, @arhen , @xXZaretXx. Have you been able to download the videos? My code can get the information about the videos, but when I try to download them, it says access denied. I modified the If you can, how do you download them? |
Check you ms_token, try to change to a new one. |
Hello! I tried your method at the date of this comment and it still does not work, we will have to find a way to prevent it from detecting it as a bot, as it seems to find the user (in my case) but when entering it comes out, it must be that it is trying to access some links so quickly or robustly that it detects it as a bot. |
I'm running: Everything works perfectly for me :/ |
Yeah! It seems to be working since I just tested it and it works but I don't know if it works with the changes made by the partner. EDIT > Stopped working xd only tried it once with the example code |
Always make sure there aren't any dependencies interfering with you code. Always use a virtual enviornment for a fresh start. When installing the TikTokApi, install |
Describe the bug
Like the title, if you runt the code example "user_example" you will get the `TikTokApi.exceptions.EmptyResponseException: None -> TikTok returned an empty response.
The buggy code
in example.user_example.py, this below code related to the error.
It means, user.info is working as expected but the videos from the user is not.
SET LOGGING LEVEL TO INFO BEFORE POSTING CODE OUTPUT
The text was updated successfully, but these errors were encountered: