Skip to content

Commit

Permalink
optimization: add try except for json parse nondanee#16
Browse files Browse the repository at this point in the history
  • Loading branch information
nondanee committed May 3, 2018
1 parent b1d94af commit 16e997f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion weiboPicDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ def get_urls(uid,video=False):
response = requests_with_retry(url=url,max_retry=3)
if response == None: continue
if response.status_code != requests.codes.ok: continue
json_data = json.loads(response.text)
try: json_data = json.loads(response.text)
except: continue
if json_data['ok'] == 0:
print_fit("finish analysis {}".format(progress(amount,total)),pin=True)
break
Expand Down

0 comments on commit 16e997f

Please sign in to comment.