From db0461ec4efe68940e8b2d7b649219019ee88c2f Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 23 Jan 2019 01:06:59 -0500 Subject: [PATCH] add timeout to title fetching --- archivebox/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/util.py b/archivebox/util.py index 761b5380..70d7e544 100644 --- a/archivebox/util.py +++ b/archivebox/util.py @@ -234,7 +234,7 @@ def fetch_page_title(url, default=True): default = url try: - html_content = urllib.request.urlopen(url).read().decode('utf-8') + html_content = urllib.request.urlopen(url, timeout=10).read().decode('utf-8') match = re.search('(.*?)', html_content) return match.group(1) if match else default or None