diff options
| author | stone <jules+okfprojz@okfoc.us> | 2018-11-05 17:33:37 -0500 |
|---|---|---|
| committer | stone <jules+okfprojz@okfoc.us> | 2018-11-05 17:33:37 -0500 |
| commit | 3d98d3753e58922fcd7620b0b7562ec58223e80e (patch) | |
| tree | 46fb4e3e12c3d7033fe38346c9f45d8edcc69f99 | |
| parent | 2cb40f0220c14cc4b42673b4b75fc04406f651ff (diff) | |
skip errorz
| -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: |
