Skip to content

Commit 773b56f

Browse files
committed
Fixed opengraph bug
1 parent 51b709b commit 773b56f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

imageresolver/plugins/opengraph.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ def get_image(self, url, soup):
1616
for ogtag in ogtags:
1717
tags = soup.find_all('meta', {ogtag['attribute']:ogtag['name']})
1818
if tags != []:
19-
ogimages = ogimages + [image[ogtag['value']] for image in tags]
19+
try:
20+
ogimages = ogimages + [image[ogtag['value']] for image in tags]
21+
except KeyError:
22+
pass
2023

2124
if len(ogimages) >= 1:
2225
logger = logging.getLogger('ImageResolver')

0 commit comments

Comments
 (0)