davidteather / TikTok-Api

The Unofficial TikTok API Wrapper In Python
https://davidteather.github.io/TikTok-Api
MIT License
4.82k stars 967 forks source link

Using different proxies to make requests but still getting error [Tiktok wants to display a catcha] #615

Closed zbtzero7 closed 3 years ago

zbtzero7 commented 3 years ago

proxies= [..] //List of proxies api = TikTokApi.get_instance(use_test_endpoints=True) for loop: user_videos = api.byUsername(username, count =n_videos, region ="PK",proxy=proxies[i], language='en')

ERROR:root:Tiktok wants to display a catcha. Response is: {"code":"10000","from":"","type":"verify","version":"","region":"sg","subtype":"slide","detail":"KOhViXRctvUqJRvJlXDrErnPG7NbSks3Z4yUYkHidC0vcmh2RU4-KfszIifRE6yLwWH2Uvhl5O-zDPGaVqh1wxc4PTEZjbf8yzOfStxYllTXFvb-WT0nU8M-d2QpgM-pdFLFiUKW8ZJeuvNbfVaxPUeqtyBVLvXpR06tUd7EGJy0Bz125H-MOGPwT5g3kMLUi2LCKb9rooZZ3t1A58juuIvhixdKK4PtqoLcj8SVc56MotgSUHtHlk7ErVDrvdvHak9M1r7aMfHsVz5uRkfMYlrtgyU2gRPn0mqxshgB9KE7hrjsaRay0Vphs-MJWJnoJ62lthM6FEwx22Ghc50TWnLgRlMov0v9AUsp2iSfcCKvS4h78MnctVUEoUBFk448GGbacN3UUtSuaCmXyJWQG-MqQJVZEyo.","verify_event":"","fp":"verify_khr3jabg_V7ucdslq_Vrw9_4KPb_AJ1b_Ks706M8zIJTq","scene":"","verify_ticket":"","channel_mobile":"","sms_content":"","mobile":"","email":""} ERROR:root:{'tt_webid': '7557659015042569959', 'tt_webid_v2': '7557659015042569959', 'tt_csrf_token': 'TNscNSsyCYAEEfph'} GetVideoDetails Exception: TikTok blocks this request displaying a Captcha Tip: Consider using a proxy or a custom_verifyFp as method parameters

djmarioka commented 3 years ago

Hi,

I've got the same issue, could you fix it?.

Thanks.

Juan-Rivera commented 3 years ago

Having this issue with proxies as well.

zbtzero7 commented 3 years ago

Yeah still experiencing it

kpopdev commented 3 years ago

me too please fix this.

Tiktok wants to display a catcha. Response is: Jun 18 13:23:26 vmi538808.contaboserver.net python[16493]: {"code":"10000","from":"","type":"verify","version":"","region":"sg","subtype":"slide","detail":"p8nkiqni96haXI2VVM43kxs2IJwT7X5TrX9xKNTiAHKZ2YGOfsDl2K3IZANNkxgV2ZLK5QX-MupIjL3DQUQHxUhAk0rnNGUpoKzixo4oSD0z3rptJ5RX-vu8I46S5qFCkVButYLhvCdXPI-fA-YFv6F5fKjQHs32qRNz6vnmh8ZUO14N3-ZrKi7KBQnpdjMWmZObGCU94VhAlMjyBQYbqhDBT03dbbkPBlwNuMrxhXcU-7bd69SnUOapbhXHgFjnXTnwPtiHxecMEizMGy9P1ugeu81bC8Yc1QPmXQvv7j9giUDZhAna54AGH5JEX6fkjpkAS4Y5Q5MhHVRNQm7j5Pvg6nttRvWivfpN0Jav9aDlHfKUF49sTo8d0M6NF6min9-OSr9iQSw9wPca8au8RGOkg.","verify_event":"","fp":"verify_kq1zc3c7_hYFi41sC_nbkl_4BPH_9Flh_uOrli7F3Jo9m","scene":"","verify_ticket":"","channel_mobile":"","sms_content":"","mobile":"","email":""} Jun 18 13:23:26 vmi538808.contaboserver.net python[16493]: [2021-06-18 13:23:26] [ERROR] root: {'tt_webid': '4527750574570371440', 'tt_webid_v2': '4527750574570371440', 'csrf_session_id': 'f46e0f0070bd48b6a989e594c7439288', 'tt_csrf_token': 'tEdMBICnSpCSxJQM'} Jun 18 13:23:26 vmi538808.contaboserver.net python[16493]: [2021-06-18 13:23:26] [WARNING] tiktok: Captcha error, retrying..

kpopdev commented 3 years ago

@vdemay hi can you please fix it for us again thank you<3 sorry for the ping

kpopdev commented 3 years ago

Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: [2021-06-18 14:56:04] [ERROR] root: Tiktok response: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: <!DOCTYPE html> Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: TikTok Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]:

Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]:
Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]:
Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]:
Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]:
Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]:

Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]:
Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: Jun 18 14:56:04 vmi538808.contaboserver.net python[12064]: [2021-06-18 14:56:04] [WARNING] tiktok: Captcha error, retrying..

also this error is new i think.

davidteather commented 3 years ago

You should provide a custom_verifyFp to the constructor method. There’s a YouTube guide linked in the readme on how to set this up. Also make sure you’re on latest version :)

kpopdev commented 3 years ago

(redenv) root@vmi538808:~# pip install TikTokApi -U Requirement already satisfied: TikTokApi in ./redenv/lib/python3.8/site-packages (3.9.9) also im using custom_verifyFp too.

davidteather commented 3 years ago

Can you provide the code that you’re running?

kpopdev commented 3 years ago

i send u on discord. please check it thank u so much bro.

felixwann commented 3 years ago

the same issue,i used 2000 proxies but still getting error 'Tiktok wants to display a catcha' when I was getting tiktoks by hashTag:

count = 1665
tag = "cat"
suffix = ""
proxy_list = {
# proxy list json:
# ...
}
password = ""

print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
    for val in proxy_list:
        proxy_server = "https://"+suffix+val+":"+password
        api = TikTokApi().get_instance(proxy=proxy_server)
        try:
            tiktoks = api.byHashtag(tag, count=count)
            j = json.dumps(tiktoks)
            print("\033[0;32;40m Proxy Server: " + proxy_server + " works!\033[0m")
            curTime = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())
            file_path = "./results/getTiktoksByHashtag_" + tag + "_" + curTime + ".json"
            with open(file_path, "w", encoding="utf-8") as f:
                f.write(str(j))
                print("\033[0;32;40m Scrap file was successfully created in:  " + file_path + " \033[0m")
            api.clean_up()
            break
        except Exception as e:
            print("\033[1;31m Proxy Server: " + proxy_server + " doesn't work , trying to use the next server...\033[0m")
            print(e)
            time.sleep(3)
            api.clean_up()
            continue
    print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
dylancaponi commented 3 years ago

@felixwann Proxies are not enough. Follow the docs and add a verifyFp: https://www.youtube.com/watch?v=zwLmLfVI-VQ

kpopdev commented 3 years ago

we find a fix for this error check https://github.com/davidteather/TikTok-Api/issues/627 and also watch https://youtu.be/MgjorCvPzxg