aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/yandexmusic.py
diff options
context:
space:
mode:
authorDesweR <egomail@inbox.ru>2015-10-13 16:29:16 +0700
committerSergey M․ <dstftw@gmail.com>2015-10-13 22:17:42 +0600
commit3eeff489e80838cd2d1b3f55fc96db747386fd50 (patch)
treec53eff6ee00526f7a342d2c4b1be7d04154a9166 /youtube_dl/extractor/yandexmusic.py
parent5946cda7c6f2e4a7eb90fff6f10c66af0ff2a0d7 (diff)
Extract thumbnail url
Diffstat (limited to 'youtube_dl/extractor/yandexmusic.py')
-rw-r--r--youtube_dl/extractor/yandexmusic.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/youtube_dl/extractor/yandexmusic.py b/youtube_dl/extractor/yandexmusic.py
index 4098e4629..6842f834f 100644
--- a/youtube_dl/extractor/yandexmusic.py
+++ b/youtube_dl/extractor/yandexmusic.py
@@ -46,6 +46,14 @@ class YandexMusicTrackIE(InfoExtractor):
% (data['host'], key, data['ts'] + data['path'], storage[1]))
def _get_track_info(self, track):
+ album = track['albums'][0]
+ a_thumb = None
+
+ if 'coverUri' in album:
+ a_thumb = album['coverUri']
+ if a_thumb:
+ a_thumb = 'http://' + a_thumb.replace('%%', '1000x1000')
+
return {
'id': track['id'],
'ext': 'mp3',
@@ -53,6 +61,7 @@ class YandexMusicTrackIE(InfoExtractor):
'title': '%s - %s' % (track['artists'][0]['name'], track['title']),
'filesize': int_or_none(track.get('fileSize')),
'duration': float_or_none(track.get('durationMs'), 1000),
+ 'thumbnail': a_thumb,
}
def _real_extract(self, url):