From 3d98d3753e58922fcd7620b0b7562ec58223e80e Mon Sep 17 00:00:00 2001 From: stone Date: Mon, 5 Nov 2018 17:33:37 -0500 Subject: skip errorz --- s2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 's2.py') diff --git a/s2.py b/s2.py index f3b1176f..ca03e22e 100644 --- a/s2.py +++ b/s2.py @@ -122,8 +122,11 @@ class SemanticScholarAPI(object): @staticmethod def fetch_file(url, fn, **kwargs): - resp = requests.get(url, params=kwargs, headers=SemanticScholarAPI.headers, verify=False) - if resp.status_code != 200: + try: + resp = requests.get(url, params=kwargs, headers=SemanticScholarAPI.headers, verify=False) + if resp.status_code != 200: + return None + except: return None size = 0 with open(fn, 'wb') as f: -- cgit v1.2.3-70-g09d2