From 8187876a063f9a887c797168df36bdc1a0aaf1ca Mon Sep 17 00:00:00 2001 From: pictuga Date: Thu, 23 Apr 2020 11:23:45 +0200 Subject: [PATCH] crawler: stop at first alternative link Should save a few ms and the first one is usually (?) the most relevant/generic --- morss/crawler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/morss/crawler.py b/morss/crawler.py index 94669d6..cc61c7b 100644 --- a/morss/crawler.py +++ b/morss/crawler.py @@ -252,6 +252,7 @@ class AlternateHandler(BaseHandler): resp.code = 302 resp.msg = 'Moved Temporarily' resp.headers['location'] = link.get('href') + break fp = BytesIO(data) old_resp = resp