summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstone <jules+okfprojz@okfoc.us>2018-11-05 17:33:37 -0500
committerstone <jules+okfprojz@okfoc.us>2018-11-05 17:33:37 -0500
commit3d98d3753e58922fcd7620b0b7562ec58223e80e (patch)
tree46fb4e3e12c3d7033fe38346c9f45d8edcc69f99
parent2cb40f0220c14cc4b42673b4b75fc04406f651ff (diff)
skip errorz
-rw-r--r--s2.py7
1 files changed, 5 insertions, 2 deletions
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: