From 730103121e72ab515979a00341c8a44e362edc71 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 26 Oct 2021 15:17:53 -0700 Subject: ia helpers: enforce max_redirects count correctly AKA, should run fetch even if max_redirects = 0; the first loop iteration is not a redirect. --- python/sandcrawler/ia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/sandcrawler') diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py index ad685aa..1148de2 100644 --- a/python/sandcrawler/ia.py +++ b/python/sandcrawler/ia.py @@ -681,7 +681,7 @@ class WaybackClient: """ next_url = start_url urls_seen = [start_url] - for i in range(self.max_redirects): + for i in range(self.max_redirects + 1): print(" URL: {}".format(next_url), file=sys.stderr) cdx_row = self.cdx_client.lookup_best(next_url, best_mimetype=best_mimetype, -- cgit v1.2.3