diff options
Diffstat (limited to 'scraper/util.py')
| -rw-r--r-- | scraper/util.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scraper/util.py b/scraper/util.py index 2d7c2ccb..9b47510a 100644 --- a/scraper/util.py +++ b/scraper/util.py @@ -331,11 +331,11 @@ def fetch_paper(s2, paper_id): print(paper_id) paper = s2.paper(paper_id) if paper is None: - print("Got none paper??") + print("Paper not found: {}".format(paper_id)) # time.sleep(random.randint(1, 2)) paper = s2.paper(paper_id) if paper is None: - print("Paper not found") + # print("Paper not found") return None write_json(paper_fn, paper) # time.sleep(random.randint(1, 2)) @@ -343,7 +343,8 @@ def fetch_paper(s2, paper_id): def fetch_spreadsheet(): scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive'] - credentials = ServiceAccountCredentials.from_json_keyfile_name('./.creds/Megapixels-ef28f91112a9.json', scope) + path = os.path.dirname(os.path.abspath(__file__)) + credentials = ServiceAccountCredentials.from_json_keyfile_name(os.path.join(path, '.creds/Megapixels-ef28f91112a9.json'), scope) docid = "1denb7TjYsN9igHyvYah7fQ0daABW32Z30lwV7QrDJQc" client = gspread.authorize(credentials) spreadsheet = client.open_by_key(docid) |
