From f7b685ad81ff3969f5425b14d1d7c1c807a40f1c Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Sun, 15 Oct 2017 23:34:55 +0200 Subject: [PATCH] ignore messed up web servers --- screenless/bureau/publications/publications.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/screenless/bureau/publications/publications.py b/screenless/bureau/publications/publications.py index 791f4dc..cce59a3 100644 --- a/screenless/bureau/publications/publications.py +++ b/screenless/bureau/publications/publications.py @@ -182,6 +182,10 @@ class Publications(Bureau): self.log.warning("Timeout fetching OpenGraph data from document %s", url) return ogdata + except (requests.exceptions.ConnectionError): + self.log.warning("Connection errors fetching OpenGraph from %s", + url) + return ogdata except requests.exceptions.MissingSchema: self.log.warning("Can't get OpenGraph data from bogus URL %s", url) return ogdata @@ -196,7 +200,6 @@ class Publications(Bureau): if prop.startswith("og:"): prop = prop[3:] ogdata[prop] = val - print("set og:", prop, "to", val) return ogdata @@ -274,7 +277,6 @@ class Publications(Bureau): entry.img = og_data["image"] else: entry.img = " " - print("og image set to:", entry.img) thread = threading.Thread(target=fetch_og, args=(entry,)) threads.append(thread)