davidteather / TikTok-Api

The Unofficial TikTok API Wrapper In Python
https://davidteather.github.io/TikTok-Api
MIT License
4.88k stars 976 forks source link

[BUG] - Captcha solving necessary for byHashtag despite custom_verifyFp #461

Closed len-n-a-rt closed 3 years ago

len-n-a-rt commented 3 years ago

The following error is throwing when getting TikToks by hashtag despite using custom_verifyFp and proxy.

TikTokApi.exceptions.TikTokCaptchaError: TikTok blocks this request displaying a Captcha Tip: Consider using a proxy or a custom_verifyFp as method parameters

Will add later more infos if necessary.

Bengejd commented 3 years ago

This seems to happen on any endpoint, if you're making too many requests in a short amount of time. My recommendation is to try to do iterative requests, and then either wait a short bit (unsure of the timing) or when you hit that error, to switch IP's via a vpn.

len-n-a-rt commented 3 years ago

But it was my first request these day. I switched then to "trending" and this still works under the same ip. So, I thought is maybe a new specific security measure connected to hashtag queries.

Bengejd commented 3 years ago

It's possible that the TikTok server is apart of a Kubernetes cluster, and has independent lockout verifications for each endpoint. I just tested this endpoint on my own, and it returned everything without asking for a captcha solution, so I'm assuming you just ran through your "limit" of requests in a short period of time for that endpoint previously, and now it's locking you out, to make sure that you're not scraping (which we are). Try giving it another day or so, and see if it locks you out again, and if that's the case, your IP might be flagged for the api endpoint.

davidteather commented 3 years ago

switched to trending

Trending seems to have less restrictions because it’s the landing page

davidteather commented 3 years ago

There's a YouTube video linked in the readme on how to avoid this now