From a9ea0941445929ae403c49e4883d44574830a011 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 14 Oct 2015 13:48:03 -0400 Subject: [PATCH] apply fix for json parse error --- contrib/tools/archive/nntparchive/archiver.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/contrib/tools/archive/nntparchive/archiver.py b/contrib/tools/archive/nntparchive/archiver.py index a6a86c5..16ab248 100755 --- a/contrib/tools/archive/nntparchive/archiver.py +++ b/contrib/tools/archive/nntparchive/archiver.py @@ -119,11 +119,15 @@ class Getter: """ r = requests.get(self.url) if r.status_code == 200: - j = r.json() - for t in j['threads']: - posts = t['posts'] - for post in posts: - yield Article(post, self.board, self.site) + try: + j = r.json() + except: + pass + else: + for t in j['threads']: + posts = t['posts'] + for post in posts: + yield Article(post, self.board, self.site)