Fix the detection of meta name=og:image thumbnails

This commit is contained in:
John Drinkwater
2013-06-18 11:35:40 +01:00
committed by Neil Williams
parent 3bc028c712
commit 0a88e50773

View File

@@ -201,7 +201,8 @@ class Scraper:
max_url = None
if self.soup:
og_image = self.soup.find('meta', property='og:image')
og_image = (self.soup.find('meta', property='og:image') or
self.soup.find('meta', attrs={'name': 'og:image'}))
if og_image and og_image['content']:
log.debug("Using og:image")
return og_image['content']