aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/kickstarter.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-06-09 11:41:17 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-06-09 11:54:13 +0800
commit627b96482567c1525dddfcceae2c16ff53c18b6a (patch)
tree328bf84f585d74db307d59b5b80fe2d1246cbf93 /youtube_dl/extractor/kickstarter.py
parenta55e36f48d1f0dc5454b144c7373361f284b9236 (diff)
[kickstarted] Extract thumbnails in embedded videos (#5929)
Diffstat (limited to 'youtube_dl/extractor/kickstarter.py')
-rw-r--r--youtube_dl/extractor/kickstarter.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/youtube_dl/extractor/kickstarter.py b/youtube_dl/extractor/kickstarter.py
index 7d4b57056..1d391e69f 100644
--- a/youtube_dl/extractor/kickstarter.py
+++ b/youtube_dl/extractor/kickstarter.py
@@ -28,6 +28,14 @@ class KickStarterIE(InfoExtractor):
'uploader': 'Pebble Technology',
'title': 'Pebble iOS Notifications',
}
+ }, {
+ 'url': 'https://www.kickstarter.com/projects/1420158244/power-drive-2000/widget/video.html',
+ 'info_dict': {
+ 'id': '1420158244',
+ 'ext': 'mp4',
+ 'title': 'Power Drive 2000',
+ },
+ 'expected_warnings': ['OpenGraph description'],
}]
def _real_extract(self, url):
@@ -48,10 +56,15 @@ class KickStarterIE(InfoExtractor):
'title': title,
}
+ thumbnail = self._og_search_thumbnail(webpage, default=None)
+ if thumbnail is None:
+ thumbnail = self._html_search_regex(
+ r'<img[^>]+class="[^"]+\s*poster\s*[^"]+"[^>]+src="([^"]+)"',
+ webpage, 'thumbnail image', fatal=False)
return {
'id': video_id,
'url': video_url,
'title': title,
'description': self._og_search_description(webpage),
- 'thumbnail': self._og_search_thumbnail(webpage),
+ 'thumbnail': thumbnail,
}