|
|
@ -182,6 +182,10 @@ class Publications(Bureau):
|
|
|
|
self.log.warning("Timeout fetching OpenGraph data from document %s",
|
|
|
|
self.log.warning("Timeout fetching OpenGraph data from document %s",
|
|
|
|
url)
|
|
|
|
url)
|
|
|
|
return ogdata
|
|
|
|
return ogdata
|
|
|
|
|
|
|
|
except (requests.exceptions.ConnectionError):
|
|
|
|
|
|
|
|
self.log.warning("Connection errors fetching OpenGraph from %s",
|
|
|
|
|
|
|
|
url)
|
|
|
|
|
|
|
|
return ogdata
|
|
|
|
except requests.exceptions.MissingSchema:
|
|
|
|
except requests.exceptions.MissingSchema:
|
|
|
|
self.log.warning("Can't get OpenGraph data from bogus URL %s", url)
|
|
|
|
self.log.warning("Can't get OpenGraph data from bogus URL %s", url)
|
|
|
|
return ogdata
|
|
|
|
return ogdata
|
|
|
@ -196,7 +200,6 @@ class Publications(Bureau):
|
|
|
|
if prop.startswith("og:"):
|
|
|
|
if prop.startswith("og:"):
|
|
|
|
prop = prop[3:]
|
|
|
|
prop = prop[3:]
|
|
|
|
ogdata[prop] = val
|
|
|
|
ogdata[prop] = val
|
|
|
|
print("set og:", prop, "to", val)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ogdata
|
|
|
|
return ogdata
|
|
|
|
|
|
|
|
|
|
|
@ -274,7 +277,6 @@ class Publications(Bureau):
|
|
|
|
entry.img = og_data["image"]
|
|
|
|
entry.img = og_data["image"]
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
entry.img = " "
|
|
|
|
entry.img = " "
|
|
|
|
print("og image set to:", entry.img)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thread = threading.Thread(target=fetch_og, args=(entry,))
|
|
|
|
thread = threading.Thread(target=fetch_og, args=(entry,))
|
|
|
|
threads.append(thread)
|
|
|
|
threads.append(thread)
|
|
|
|