]> git.bitcoin.ninja Git - youtube-dl/commitdiff
Steam: get thumbnails
authorJaime Marquínez Ferrándiz <jaimemf93@gmail.com>
Sat, 23 Feb 2013 15:48:15 +0000 (16:48 +0100)
committerJaime Marquínez Ferrándiz <jaimemf93@gmail.com>
Sat, 23 Feb 2013 15:48:15 +0000 (16:48 +0100)
youtube_dl/InfoExtractors.py

index d3c3ac2640447af6da4f42c48cb607a1383ace84..64a6cfbc8fa68ef34165eb1881c36ff7edbd2adf 100755 (executable)
@@ -3627,18 +3627,22 @@ class SteamIE(InfoExtractor):
         mweb = re.finditer(urlRE, webpage)
         namesRE = r'<span class="title">(?P<videoName>.+?)</span>'
         titles = re.finditer(namesRE, webpage)
+        thumbsRE = r'<img class="movie_thumb" src="(?P<thumbnail>.+?)">'
+        thumbs = re.finditer(thumbsRE, webpage)
         videos = []
-        for vid,vtitle in zip(mweb,titles):
+        for vid,vtitle,thumb in zip(mweb,titles,thumbs):
             video_id = vid.group('videoID')
             title = vtitle.group('videoName')
             video_url = vid.group('videoURL')
+            video_thumb = thumb.group('thumbnail')
             if not video_url:
                 self._downloader.trouble(u'ERROR: Cannot find video url for %s' % video_id)
             info = {
                 'id':video_id,
                 'url':video_url,
                 'ext': 'flv',
-                'title': unescapeHTML(title)
+                'title': unescapeHTML(title),
+                'thumbnail': video_thumb
                   }
             videos.append(info)
         return videos