question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] - TikTokApi.exceptions.CaptchaException when running example `search_example.py`

See original GitHub issue

Fill Out the template 😃

Describe the bug

when running example search_example.py the following error is returned

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

The buggy code

import logging
TikTokApi(logging_level=logging.INFO) # SETS LOGGING_LEVEL TO INFO
# Hopefully the info level will help you debug or at least someone else on the issue
from TikTokApi import TikTokApi

with TikTokApi() as api:
    for user in api.search.users("therock"):
        print(user.username)

    for sound in api.search.sounds("funny"):
        print(sound.title)

    for hashtag in api.search.hashtags("funny"):
        print(hashtag.name)

Expected behavior

Example can successfully run

Error Trace (if any)

Put the error trace below if there’s any error thrown.

# Error Trace Here

Desktop (please complete the following information):

  • OS: MacOS
  • TikTokApi Version 5.x.x

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

13reactions
aitrepreneurcommented, Jul 21, 2022

same exact issue, actually none of the examples code work, each time it gives the same error:

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

I tried putting a custom_verify_fp or even using a proxy, same issue, absolutely nothing works…

2reactions
jhough-veritonecommented, Aug 25, 2022

I’ve been running into the same issue, and I think it is related specifically to when you are searching a user instance. For example, when you use the API to search the data for a specific video the captcha exception does not come up. However, trying to search for information specific to a user will raise the Captcha exception whether or not you’re using a proxy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unofficial TikTok API in Python - TikTokApi · PyPI
Unofficial TikTok API in Python. This is an unofficial api wrapper for TikTok.com in python. With this api you are able to call...
Read more >
Captcha error with Python TikTokApi (from davidteather)
Here is the error I get running it: TikTokApi.exceptions.TikTokCaptchaError: TikTok blocks this request displaying a Captcha Tip: Consider ...
Read more >
Captcha error with Python TikTokApi (from david...anycodings
Here is my minimalist TikTokApi Python code: #!/usr/bin/env python3.7 #-*-coding:utf-8-*- from TikTokApi import TikTokApi import datetime ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found