aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-10-01 22:08:16 +0600
committerSergey M․ <dstftw@gmail.com>2015-10-01 22:20:21 +0600
commit1e5bcdec0264190ed2a05ee49c1f9f5b20ba3aa6 (patch)
tree48bf1df12f2965f82e530628598ca2580ec95902
parente7d8e98a9ffdec2502bedb21a4f043df6da225a5 (diff)
downloadyoutube-dl-1e5bcdec0264190ed2a05ee49c1f9f5b20ba3aa6.tar.xz
[extractor/common] Extract images from SMIL
-rw-r--r--youtube_dl/extractor/common.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 9c40d56a9..5684227dc 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -1054,10 +1054,18 @@ class InfoExtractor(object):
elif not description and name in ('description', 'abstract'):
description = content
+ thumbnails = [{
+ 'id': image.get('type'),
+ 'url': image.get('src'),
+ 'width': int_or_none(image.get('width')),
+ 'height': int_or_none(image.get('height')),
+ } for image in smil.findall(self._xpath_ns('.//image', namespace)) if image.get('src')]
+
return {
'id': video_id,
'title': title or video_id,
'description': description,
+ 'thumbnails': thumbnails,
'formats': formats,
'subtitles': subtitles,
}