From 478903401f480f2284f8f534ac5ef9b99fdc0b1c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 10 Feb 2019 16:53:29 +0100 Subject: timeouts --- scraper/s2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scraper/s2.py b/scraper/s2.py index b1b9742c..01c0b4d5 100644 --- a/scraper/s2.py +++ b/scraper/s2.py @@ -125,7 +125,7 @@ class SemanticScholarAPI(object): @staticmethod def fetch_file(url, fn, **kwargs): try: - resp = requests.get(url, params=kwargs, headers=SemanticScholarAPI.headers, verify=False) + resp = requests.get(url, params=kwargs, headers=SemanticScholarAPI.headers, verify=False, timeout=10) if resp.status_code != 200: return None except: @@ -141,7 +141,7 @@ class SemanticScholarAPI(object): @staticmethod def fetch_doi(url, fn, **kwargs): try: - resp = requests.get(url, params=kwargs, headers=SemanticScholarAPI.headers, verify=False) + resp = requests.get(url, params=kwargs, headers=SemanticScholarAPI.headers, verify=False, timeout=10) if resp.status_code != 200: return None, None except: -- cgit v1.2.3-70-g09d2