diff options
Diffstat (limited to 's2.py')
| -rw-r--r-- | s2.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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: |
