TikTok-Api: [BUG] - TikTok blocks this request displaying a Captcha

Description of the bug Systematic captcha error when using by_username method. Error message advises using proxy or a custom_verifyFp but this bug would also appear after a while in previous versions for which I had tried using proxy or a custom_verifyFp without success until a new version eventually fixed this issue. And this has happened quite a few times actually so I suppose you might know how to fix it again now. When you do, I’d be glad if you could explain how you did it, so I can fix it myself in the future and upload pull request quickly since I use your API on a daily basis.

The buggy code

from TikTokApi import TikTokApi as t
api = t.get_instance()
k = api.by_username("")

Error Trace

ERROR:root:Tiktok wants to display a catcha. Response is:
{"code":"10000","from":"","type":"verify","version":"","region":"va","subtype":"slide","detail":"GDIqyl9SLA5lVSsn4JVxPJ2cYRgDuhDP2NBDA0FqMagtMGQB8TGV2kpodkbZzjHKYcgIzsCRQbF60HRg3l9Qauc2Do6mMa-0Zg5zDKWegm2X6nPmvd0*iT3sZKcm1jeSXuYDR8MliQ8C-w5slo0ucQ-I1mouIfpZAPBvtuqCaLlitjnBe-x9821RxB7KI1poAlO19vIyMqX4daxORf7eHrqKoJv7CA03WhiLzQT0*0mhfkO1deNBCczMZ6SIL6hTp6aUbCoqz51dHuiKM-cGG*WHzU*snEBYxNaixbl84PVCwRqDYF1byBZiBDJ8jU50uDiiJ53EL3dtYdXtcoWBr6Q8F1Cly-FTFBOuwusDQEbR*bKMA23oExlFHGvq2mAlpYmzG*v-6mvF64wPNe1i1xh-qHQPS3zWJxo.","verify_event":"","fp":"verify_khr3jabg_V7ucdslq_Vrw9_4KPb_AJ1b_Ks706M8zIJTq","scene":"","verify_ticket":"","channel_mobile":"","sms_content":"","mobile":"","email":""}
ERROR:root:{'tt_webid': '1637611630395385016', 'tt_webid_v2': '1637611630395385016', 'csrf_session_id': '13d94c933ff245fd8bf4696164422b16', 'tt_csrf_token': 'vAtEBuHpdiZmCVUk'}
Traceback (most recent call last):
  File "C:\Users\me\Documents\0_Projet\herer\testt\bug.py", line 4, in <module>
    k = api.by_username(us)
  File "C:\Users\me\AppData\Roaming\Python\Python37\site-packages\TikTokApi\tiktok.py", line 603, in by_username
    **kwargs,
  File "C:\Users\me\AppData\Roaming\Python\Python37\site-packages\TikTokApi\tiktok.py", line 563, in user_posts
    res = self.get_data(url=api_url, **kwargs)
  File "C:\Users\me\AppData\Roaming\Python\Python37\site-packages\TikTokApi\tiktok.py", line 279, 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

  • OS: Windows 10
  • TikTokApi Version : 3.9.9

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 37 (2 by maintainers)

Most upvoted comments

@Alex-Laparra this will fix all captcha errors https://youtu.be/MgjorCvPzxg just watch it. im using firefox btw but i think on other Web browsers works too.

please fix it i have same problem. im using proxies too.

lmfao . Imagine asking the maintainer to bypass captchas for you…

i think we can bypass this but im still not sure https://2captcha.com/blog/tiktok-captcha

Haven’t looked into it that much yet, but if it works, David should definitely implement it.