From bc22da30e379221c31ce466f76e1e3f048d3bcc8 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 3 Nov 2020 11:26:40 -0800 Subject: cdx: fix 'closest' support --- python/sandcrawler/ia.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py index 664bd20..b1f90ea 100644 --- a/python/sandcrawler/ia.py +++ b/python/sandcrawler/ia.py @@ -273,10 +273,8 @@ class CdxApiClient: if closest: params['closest'] = closest params['sort'] = "closest" - print(params) + #print(params, file=sys.stderr) rows = self._query_api(params) - for r in rows: - print(f" {r.datetime}") if not rows: return None @@ -984,6 +982,7 @@ class SavePageNowClient: elsevier_pdf_cdx = wayback_client.cdx_client.lookup_best( spn_result.request_url, best_mimetype="application/pdf", + closest=closest, ) if elsevier_pdf_cdx and elsevier_pdf_cdx.mimetype == "application/pdf": print("Trying pdf.sciencedirectassets.com hack!", file=sys.stderr) -- cgit v1.2.3