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

[BUG] - TikTok blocks this request displaying a Captcha even with custom_verifyFp

Open jasonrichdarmawan opened this issue 3 years ago • 10 comments

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.

jasonrichdarmawan avatar Feb 28 '22 05:02 jasonrichdarmawan

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

NatiJoseph avatar Feb 28 '22 08:02 NatiJoseph

Hey folks, any news or suggested workarounds here? thanks!

henriquekr avatar Mar 03 '22 00:03 henriquekr

Please fix this situation

4SERGEEV avatar Mar 04 '22 09:03 4SERGEEV

i have the same issue. sadly its hardly usable in this condition. hopefully that is fixable.

nathanoy avatar Mar 04 '22 16:03 nathanoy

Here I made a solution that work for me. https://github.com/nazar-mykolyshyn/TikTok-Api/releases/tag/5.1.0

tech-alpiner avatar Mar 13 '22 11:03 tech-alpiner

I use the solution from @roman-dmytriv .

Is still doesnt work

kareemrasheed89 avatar Mar 26 '22 09:03 kareemrasheed89

I tried @roman-dmytriv 's fork as well and it still threw a captcha

RobLOlson avatar Apr 01 '22 00:04 RobLOlson

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?

henriquekr avatar Jun 03 '22 01:06 henriquekr

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.

tech-alpiner avatar Jun 03 '22 13:06 tech-alpiner

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.

thaornguyen avatar Jun 07 '22 02:06 thaornguyen

Try v6 will require msToken

davidteather avatar Aug 08 '23 22:08 davidteather