aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParmjit Virk <pvirk@mts.net>2018-01-04 19:25:42 -0600
committerSergey M <dstftw@gmail.com>2018-01-05 08:25:42 +0700
commit0b0870f9d0dd3e72be3ff6be6bfa9fa43b693b50 (patch)
tree38a2f3b02b8932df1dd87a55b840cf8443870aea
parentc2f18e1c4915d43b37c12337dc4fbae68d43a304 (diff)
downloadyoutube-dl-0b0870f9d0dd3e72be3ff6be6bfa9fa43b693b50.zip
youtube-dl-0b0870f9d0dd3e72be3ff6be6bfa9fa43b693b50.tar.gz
youtube-dl-0b0870f9d0dd3e72be3ff6be6bfa9fa43b693b50.tar.bz2
[soundcloud] Fallback to avatar picture for thumbnail (closes #12878)
-rw-r--r--youtube_dl/extractor/soundcloud.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dl/extractor/soundcloud.py
index 8894f4b..6c9816e 100644
--- a/youtube_dl/extractor/soundcloud.py
+++ b/youtube_dl/extractor/soundcloud.py
@@ -136,6 +136,25 @@ class SoundcloudIE(InfoExtractor):
'license': 'all-rights-reserved',
},
},
+ # no album art, use avatar pic for thumbnail
+ {
+ 'url': 'https://soundcloud.com/garyvee/sideways-prod-mad-real',
+ 'md5': '59c7872bc44e5d99b7211891664760c2',
+ 'info_dict': {
+ 'id': '309699954',
+ 'ext': 'mp3',
+ 'title': 'Sideways (Prod. Mad Real)',
+ 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
+ 'uploader': 'garyvee',
+ 'upload_date': '20170226',
+ 'duration': 207,
+ 'thumbnail': r're:https?://.*\.jpg',
+ 'license': 'all-rights-reserved',
+ },
+ 'params': {
+ 'skip_download': True,
+ },
+ },
]
_CLIENT_ID = 'c6CU49JDMapyrQo06UxU9xouB9ZVzqCn'
@@ -160,7 +179,7 @@ class SoundcloudIE(InfoExtractor):
name = full_title or track_id
if quiet:
self.report_extraction(name)
- thumbnail = info.get('artwork_url')
+ thumbnail = info.get('artwork_url') or info.get('user', {}).get('avatar_url')
if isinstance(thumbnail, compat_str):
thumbnail = thumbnail.replace('-large', '-t500x500')
ext = 'mp3'