TikTok-Api icon indicating copy to clipboard operation
TikTok-Api copied to clipboard

[BUG] - “TikTok blocks this request displaying a Captcha” on the shell

Open j-teng96 opened this issue 2 years ago • 6 comments

  def getuser(request,name):
      verifyFp='xxxxxxxxxx'(my verifyFp from tiktok)
      api = TikTokApi(custom_verify_fp=verifyFp)
      user = api.user(username=name)
      for video in user.videos():
          print(video.id)
      return HttpResponse(name)

when I run this, it will be like that:

Tiktok wants to display a captcha.
Response:
{"code":"10000","from":"shark_admin","type":"verify","version":"","region":"sg","subtype":"slide","detail":"5eILMhw8rUKLAYMmnnurKlbvhR1GETu0p*zFvAIjXOZJK031OMGcossIXBCR8TeYz-fy7-UpdJ8FoI7XeUnBZchiQNXQ3BQ5vMiw7DxgI*n91aPg1C6rDr92yFtwue52cZrttnC4oShSo4Zz5D4AIPYykrLCRPc3jhjuwXYPnNOrgHjMKlVENqe0bbxY9TbdIBMf*Qh4zLog-*UpKGzRnjan9cXTmf4KLxA40zmdhvIuzIghbGjOFF*6W0Wf*TnQwOguvjRFfFFh-lGc*fmwa8fruePp9CRKz30wNRZ1bx3U*n2bNEFtTKN*JrmFXvEW9hjvwX1NZIsUkgRlAKV6b1m1HBIZ*Jlbkdrch6uUkwzylBd8Tg..","verify_event":"","fp":"verify_l7iqjucd_HMwlY7C5_Lene_4zA3_A85R_kYis4xkdOU2T","server_sdk_env":"{\"idc\":\"sg1\",\"region\":\"ALISG\",\"server_type\":\"business\"}"}
Cookies:
{'tt_webid': '4227498829671749434', 'tt_webid_v2': '4227498829671749434', 'csrf_session_id': None, 'tt_csrf_token': 'NTOPeSiCYiTqVrcx', 'ttwid': '1%7CYTwiijKpPnM6h-8hHXc4-8DeOU7QPAdoicQT_cjDQzM%7C1662081160%7C040f9c8e9a3d62083969bc50cb7a787e56b1191d7fee6979cf1d136e7ddd9b07'}
URL:
https://www.tiktok.com/api/search/user/full/?aid=1988&app_name=tiktok_web&device_platform=web_mobile&region=CN&priority_region=&os=ios&referer=&cookie_enabled=true&screen_width=1095&screen_height=1524&browser_language=zh-cn&browser_platform=iPhone&browser_name=Mozilla&browser_version=Mozilla%2F5.0+%28iPhone%3B+CPU+iPhone+OS+12_2+like+Mac+OS+X%29+AppleWebKit%2F605.1.15+%28KHTML%2C+like+Gecko%29+Version%2F16.0+Mobile%2F15E148+Safari%2F604.1&browser_online=true&timezone_name=Asia%2FShanghai&is_page_visible=true&focus_state=true&is_fullscreen=false&history_len=5&language=zh&keyword=therock&cursor=0&app_language=zh&verifyFp=verify_l7iqjucd_HMwlY7C5_Lene_4zA3_A85R_kYis4xkdOU2T&device_id=4227498829671749434&_signature=_02B4Z6wo00f01J9SgoAAAIBB.-cCUHLp8WSfU4YAAETK1e

when I open the URL on my chrome, it works.But in the shell, it always told me:

TikTokApi.exceptions.CaptchaException: 0 -> TikTok blocks this request displaying a Captcha
Tip: Consider using a proxy or a custom_verify_fp as method parameters

And I have gotten the custom_verify_fp from my tiktok.

How can I fix it? And if I want to this service is always working, how can i avoid the captcha?

j-teng96 avatar Sep 02 '22 01:09 j-teng96

I also had this issue, custom_verify_fp didn't help, using a proxy could solve it, you need a proxy with many up addresses

lirankor avatar Sep 02 '22 07:09 lirankor

I found add cookie "msToken" can help solve it.

j-teng96 avatar Sep 02 '22 07:09 j-teng96

I also had this issue, custom_verify_fp didn't help, using a proxy could solve it, you need a proxy with many up addresses

@lirankor how to proxy it?

j-teng96 avatar Sep 02 '22 07:09 j-teng96

I also had this issue, custom_verify_fp didn't help, using a proxy could solve it, you need a proxy with many up addresses

@lirankor how to proxy it?

There a many proxy providers, I didn't need residential proxy for now. Just add proxy parameter as a variable

TikTokApi(custom_verify_fp=verifyFp, proxy='user:[email protected]:8080')

lirankor avatar Sep 02 '22 07:09 lirankor

I also had this issue, custom_verify_fp didn't help, using a proxy could solve it, you need a proxy with many up addresses

@lirankor how to proxy it?

There a many proxy providers, I didn't need residential proxy for now. Just add proxy parameter as a variable

TikTokApi(custom_verify_fp=verifyFp, proxy='user:[email protected]:8080') I add proxy,also had this problem,why?

siqyka avatar Sep 04 '22 15:09 siqyka

And after add "meToken" to cookie, it's ok for get user.vedios,but there is still a "Captcha" problem about getting user.info

j-teng96 avatar Sep 06 '22 02:09 j-teng96

see my telegram bot for tiktok capthca solve https://t.me/cap_watch_dog_bot

PolcovnicGauss avatar Oct 17 '22 20:10 PolcovnicGauss

And after add "meToken" to cookie, it's ok for get user.vedios,but there is still a "Captcha" problem about getting user.info

How do you add this? can you give a example?

Tarik366 avatar Nov 07 '22 16:11 Tarik366

should be fixed use msToken

davidteather avatar Aug 08 '23 22:08 davidteather