[BUG] - EmptyResponseError
See original GitHub issueRead Below!!! If this doesn’t fix your issue delete these two lines
You may need to install chromedriver for your machine globally. Download it here and add it to your path.
Describe the bug
A clear and concise description of what the bug is.
The buggy code from TikTokApi import TikTokApi import random api = TikTokApi.get_instance() custom_did = str(random.randint(10000, 999999999))
results = 2
Since TikTok changed their API you need to use the custom_verifyFp option.
In your web browser you will need to go to TikTok, Log in and get the s_v_web_id value.
#trending = api.trending(count=results, custom_verifyFp=“”) hashtag_videos = api.byHashtag(‘covid’, count=1, custom_did=custom_did, custom_verifyFp=‘verify_kidz7cgg_Qyz7RECI_o3vI_4fjk_BDCA_uPzl1O1jjQVX’)
for tiktok in hashtag_videos: data = api.get_Video_By_TikTok(tiktok,custom_did=custom_did,custom_verifyFp=‘verify_kidz7cgg_Qyz7RECI_o3vI_4fjk_BDCA_uPzl1O1jjQVX’) print(tiktok) with open(“test.mp4”, ‘wb’) as o: o.write(data) print(‘success’) Please insert the code that is throwing errors or is giving you weird unexpected results.
# Code Goes Here
Expected behavior
A clear and concise description of what you expected to happen.
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: [e.g. Windows 10]
- TikTokApi Version [e.g. 3.3.1] - 3.8.5
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (3 by maintainers)
Top GitHub Comments
Hey everyone, I also got the empty response error, and in the tiktok.py file, I change
BASE_URL = "https://m.tiktok.com/"
toBASE_URL = "https://t.tiktok.com/"
and it works!Which is what
TikTokApi.get_instance(use_test_endpoints=True)
should do