avilash / TikTokAPI-Python

TikTok API Python Wrapper
http://avilashkumar.com/TikTokAPI-Python/
MIT License
443 stars 114 forks source link

JSONDecodeError: Expecting value: line 1 column 1 (char 0) #8

Open edotop opened 4 years ago

edotop commented 4 years ago

When I run test_hashtag.py I get this error:

File "/home/usr/python_tiktok_venv_3/lib/python3.7/site-packages/PyTikTokAPI-0.0.4-py3.7.egg/TikTokAPI/utils.py", line 43, in get_req_json print(r.json()) File "/home/usr/python_tiktok_venv_3/lib/python3.7/site-packages/requests-2.24.0-py3.7.egg/requests/models.py", line 898, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/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)

It happened even when I tried to perform the test from repl.it. How can I handle it?

edotop commented 4 years ago

The status_code of the request is 403. Does it mean that i exceeded with requests? How I can handle it?

tommeuh commented 3 years ago

Hi, same problem, without exceeded requests ...

HERCULESxp commented 3 years ago

@tommeuh you need to put you cookie into of Header

VivianoRiccardo commented 3 years ago

@tommeuh did you solve it????

mikegrep commented 3 years ago

Same problem here also.After an installation.Ubuntu 18.04 python 3.6.9

mikegrep commented 3 years ago

I try with python 3.7 same Json error File "/usr/lib/python3.8/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)

Do I miss some seting before run the API.Someone fix that?

avilash commented 3 years ago

Released a new version. Adapted to all changes from Tiktok. Please run

pip install PyTikTokAPI --upgrade

Also please checkout new README to add your cookie parameters