TikTok-Api
TikTok-Api copied to clipboard
[BUG] - TikTok blocks this request displaying a Captcha even with custom_verifyFp
Describe the bug
custom_verifyFp worked last week. Today, it got blocked even with custom_verifyFp parameter. I am suspecting the cookie had expired. So, I tried to get new s_v_web_id, I usee the login with phone number method to open the Captcha box.
The buggy code
api = TikTokApi(custom_verify_fp=sys.argv[1])
user = api.user(sys.argv[2])
python tiktok.py cookie_here username_here
Expected behavior
It should return dict.
Error Trace (if any)
ERROR:root:Tiktok wants to display a catcha. Response is:
{"code":"10000", **removed as it contains the fp cookie**}
ERROR:root:{**removed as it contains csrf token**}
Traceback (most recent call last):
File "C:\Users\jason\Desktop\GitHub\learn\social-media-engagement-rate-calculator\tiktok.py", line 11, in <module>
tiktoks = api.by_username(sys.argv[2], count=postscount, custom_verifyFp=sys.argv[1])
File "C:\Users\jason\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\TikTokApi\tiktok.py", line 702, in by_username
return self.user_posts(
File "C:\Users\jason\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\TikTokApi\tiktok.py", line 666, in user_posts
res = self.get_data(url=api_url, send_tt_params=True, **kwargs)
File "C:\Users\jason\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\TikTokApi\tiktok.py", line 311, in get_data
raise TikTokCaptchaError()
TikTokApi.exceptions.TikTokCaptchaError: TikTok blocks this request displaying a Captcha
Tip: Consider using a proxy or a custom_verifyFp as method parameters
Desktop (please complete the following information):
- OS: Windows 10
- TikTokApi Version 5.0.0
Additional context
I tested it on v4.1.0 and v5.0.0, identical behavior occurs.
TikTok changed their API and the user.videos() call doesnt work anymore. you can read more here: https://github.com/davidteather/TikTok-Api/issues/838
Hey folks, any news or suggested workarounds here? thanks!
Please fix this situation
i have the same issue. sadly its hardly usable in this condition. hopefully that is fixable.
Here I made a solution that work for me. https://github.com/nazar-mykolyshyn/TikTok-Api/releases/tag/5.1.0
I use the solution from @roman-dmytriv .
Is still doesnt work
I tried @roman-dmytriv 's fork as well and it still threw a captcha
hey @roman-dmytriv, thanks for working on this. The 'msToken' solution you provided was working up until last week but when i tried running the same code today the old annoying "TikTok Displays Captcha" error came back. Any thoughts on what we could do next?
Hey @RobLOlson. Had the same issue. I will try to look at it, just need to find some time( If something is found, will let you know here as well.
Same issue, i can't get api.user(). Error is: "TikTok blocks this request displaying a Captcha". I used proxy and changed custom_verify_fp but not solved.
Try v6 will require msToken