mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Use og:image meta data for thumbnails
See also: * https://developers.facebook.com/docs/share/ * https://developers.facebook.com/tools/debug
This commit is contained in:
@@ -201,6 +201,10 @@ class Scraper:
|
||||
max_url = None
|
||||
|
||||
if self.soup:
|
||||
og_image = self.soup.find('meta', property='og:image')
|
||||
if og_image and og_image['content']:
|
||||
log.debug("Using og:image")
|
||||
return og_image['content']
|
||||
thumbnail_spec = self.soup.find('link', rel = 'image_src')
|
||||
if thumbnail_spec and thumbnail_spec['href']:
|
||||
log.debug("Using image_src")
|
||||
|
||||
Reference in New Issue
Block a user