ERROR: TikTok sent invalid JSON back #597
Unanswered
dynamiteMOJO
asked this question in
Q&A
Replies: 1 comment
-
Same issue,have you solved it yet? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
###########---CODE---###################
from TikTokApi import TikTokApi
verify_fp="verify_koplq4kn_zhApR0R4_Fp3R_4zE9_95LI_Pfj9KvmcCNmk"
api = TikTokApi.get_instance( custom_verifyFp=verify_fp, use_test_endpoints=True)
#api = TikTokApi.get_instance()
count = 30
tiktoks = api.byHashtag("funny", count=count)
for tiktok in tiktoks:
print(tiktok)
##############---ERROR---################
ERROR:root:Converting response to JSON failed
ERROR:root:Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "C:\Users\krtks\anaconda3\lib\site-packages\TikTokApi\tiktok.py", line 266, in get_data
json = r.json()
File "C:\Users\krtks\anaconda3\lib\site-packages\requests\models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\krtks\anaconda3\lib\json_init_.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Users\krtks\anaconda3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\krtks\anaconda3\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "d:/projects/TikTok/Example.py", line 148, in
tiktoks = api.byHashtag("funny", count=count)
File "C:\Users\krtks\anaconda3\lib\site-packages\TikTokApi\tiktok.py", line 925, in by_hashtag
id = self.getHashtagObject(hashtag)["challengeInfo"]["challenge"]["id"]
File "C:\Users\krtks\anaconda3\lib\site-packages\TikTokApi\tiktok.py", line 977, in get_hashtag_object
data = self.get_data(url=api_url, **kwargs)
File "C:\Users\krtks\anaconda3\lib\site-packages\TikTokApi\tiktok.py", line 292, in get_data
raise JSONDecodeFailure() from e
TikTokApi.exceptions.JSONDecodeFailure: TikTok sent invalid JSON back
Can someone please help me solve this issue?
Beta Was this translation helpful? Give feedback.
All reactions