diff --git a/utils/opengraph.py b/utils/opengraph.py index 53c71b2..91acccd 100644 --- a/utils/opengraph.py +++ b/utils/opengraph.py @@ -59,6 +59,9 @@ def fetch_og_metadata(user_agent, links): except requests.HTTPError as http_err: logger.debug(f"failed to HEAD {l}, got a {http_err.response.status_code}") continue + except requests.Timeout: + logger.debug(f"HEAD {l} timed out") + continue if not h.headers.get("content-type").startswith("text/html"): logger.debug(f"skipping {l} for bad content type") @@ -70,6 +73,9 @@ def fetch_og_metadata(user_agent, links): except requests.HTTPError as http_err: logger.debug(f"failed to GET {l}, got a {http_err.response.status_code}") continue + except requests.Timeout: + logger.debug(f"GET {l} timed out") + continue r.encoding = "UTF-8" html = r.text