1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

fixes: removed 'thumbnails field and extract all thumbnail formats

This commit is contained in:
Harry Kwon 2019-04-13 08:41:00 +00:00
parent 7330864fc7
commit 51bfe3e598

View File

@ -219,13 +219,19 @@ class SoundcloudIE(InfoExtractor):
thumbnail = info.get('artwork_url') or info.get('user', {}).get('avatar_url') thumbnail = info.get('artwork_url') or info.get('user', {}).get('avatar_url')
thumbnails = [] thumbnails = []
if isinstance(thumbnail, compat_str): if isinstance(thumbnail, compat_str):
thumbnail = thumbnail.replace('-large', '-original')
thumbnails.append({ thumbnails.append({
'url': thumbnail.replace('-original', '-t500x500'), 'url': thumbnail,
'width': 100,
'height': 100
})
thumbnails.append({
'url': thumbnail.replace('-large', '-t500x500'),
'width': 500, 'width': 500,
'height': 500 'height': 500
}) })
thumbnails.append({'url': thumbnail}) thumbnails.append({
'url': thumbnail.replace('-large', '-original'),
})
username = try_get(info, lambda x: x['user']['username'], compat_str) username = try_get(info, lambda x: x['user']['username'], compat_str)
def extract_count(key): def extract_count(key):
@ -237,7 +243,6 @@ class SoundcloudIE(InfoExtractor):
'timestamp': unified_timestamp(info.get('created_at')), 'timestamp': unified_timestamp(info.get('created_at')),
'title': title, 'title': title,
'description': info.get('description'), 'description': info.get('description'),
'thumbnail': thumbnail,
'thumbnails': thumbnails, 'thumbnails': thumbnails,
'duration': int_or_none(info.get('duration'), 1000), 'duration': int_or_none(info.get('duration'), 1000),
'webpage_url': info.get('permalink_url'), 'webpage_url': info.get('permalink_url'),