]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[polskieradio] Add thumbnails.
authorJakub Adam Wieczorek <ja.wieczorek@student.uw.edu.pl>
Thu, 7 Jul 2016 09:27:31 +0000 (11:27 +0200)
committerJakub Adam Wieczorek <ja.wieczorek@student.uw.edu.pl>
Fri, 8 Jul 2016 11:23:00 +0000 (13:23 +0200)
youtube_dl/extractor/polskieradio.py

index d3bebaea32fad6c57dc3ba56501ef92496a0e965..9e7eab12edc3e553b2ab206897287f4444d11ea6 100644 (file)
@@ -33,6 +33,7 @@ class PolskieRadioIE(InfoExtractor):
                 'timestamp': 1456594200,
                 'upload_date': '20160227',
                 'duration': 2364,
+                'thumbnail': 're:^https?://static.prsa.pl/images/.*\.jpg$'
             },
         }],
     }, {
@@ -68,6 +69,8 @@ class PolskieRadioIE(InfoExtractor):
             r'(?s)<span[^>]+id="datetime2"[^>]*>(.+?)</span>',
             webpage, 'timestamp', fatal=False))
 
+        thumbnail_url = self._og_search_thumbnail(webpage)
+
         entries = []
 
         media_urls = set()
@@ -87,6 +90,7 @@ class PolskieRadioIE(InfoExtractor):
                 'duration': int_or_none(media.get('length')),
                 'vcodec': 'none' if media.get('provider') == 'audio' else None,
                 'timestamp': timestamp,
+                'thumbnail': thumbnail_url
             })
 
         title = self._og_search_title(webpage).strip()