Archived
1
0

apply fix for json parse error

This commit is contained in:
jeff 2015-10-14 13:48:03 -04:00
parent f1037d888d
commit a9ea094144

View File

@ -119,11 +119,15 @@ class Getter:
""" """
r = requests.get(self.url) r = requests.get(self.url)
if r.status_code == 200: if r.status_code == 200:
j = r.json() try:
for t in j['threads']: j = r.json()
posts = t['posts'] except:
for post in posts: pass
yield Article(post, self.board, self.site) else:
for t in j['threads']:
posts = t['posts']
for post in posts:
yield Article(post, self.board, self.site)