TikTokAPI-Python icon indicating copy to clipboard operation
TikTokAPI-Python copied to clipboard

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

Open edotop opened this issue 5 years ago • 8 comments

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 avatar Sep 08 '20 10:09 edotop

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

edotop avatar Sep 08 '20 11:09 edotop

Hi, same problem, without exceeded requests ...

tommeuh avatar Nov 19 '20 12:11 tommeuh

@tommeuh you need to put you cookie into of Header

HERCULESxp avatar Nov 20 '20 23:11 HERCULESxp

@tommeuh did you solve it????

VivianoRiccardo avatar Nov 28 '20 19:11 VivianoRiccardo

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

mikegrep avatar Dec 18 '20 09:12 mikegrep

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?

mikegrep avatar Dec 19 '20 14:12 mikegrep

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

avilash avatar Jan 02 '21 22:01 avilash