ignore messed up web servers

workspace
Brendan Howell 7 years ago
parent a4bec0d8b0
commit f7b685ad81

@ -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)

Loading…
Cancel
Save