hacksman / spider_world

🕷spider world with me
340 stars 121 forks source link

求助 JSONDecodeError #22

Closed xia00100 closed 5 years ago

xia00100 commented 5 years ago

Traceback (most recent call last): File "video_download_run.py", line 32, in douyin_crawl.grab_user_media(sys.argv[-1], "USER_POST") File "../www_douyin_com/spiders/douyin_crawl.py", line 110, in grab_user_media hasmore, max_cursor = self.grab_video(user_id, action, content) File "../www_douyin_com/spiders/douyin_crawl.py", line 124, in grab_video real_url = gen_url(self.token, url, query_params) File "../www_douyin_com/common/utils.py", line 57, in gen_url resp = requests.post(URL.api_sign(token), json={"url": url}).json() File "/home/vts/anaconda3/lib/python3.6/site-packages/requests/models.py", line 892, in json return complexjson.loads(self.text, kwargs) File "/home/vts/anaconda3/lib/python3.6/json/init.py", line 354, in loads return _default_decoder.decode(s) File "/home/vts/anaconda3/lib/python3.6/json/decoder.py", line 342, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 5 (char 4)**

hacksman commented 5 years ago

https://github.com/hacksman/spider_world/blob/master/www_douyin_com/examples/fetch_video_test.py 直接在此处运行