From 898275c50a8af763b27f87563eb42b8c13026ad3 Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Fri, 29 Dec 2017 21:23:20 -0600 Subject: [PATCH 1/3] [Soundcloud] Also use avatar picture for thumbnail --- youtube_dl/extractor/soundcloud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dl/extractor/soundcloud.py index 8894f4b0c..d64e2f548 100644 --- a/youtube_dl/extractor/soundcloud.py +++ b/youtube_dl/extractor/soundcloud.py @@ -160,7 +160,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' From 4e89935e6d2e8d18d9f1f6a8a1fd0f4181a514d5 Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Thu, 4 Jan 2018 18:09:33 -0600 Subject: [PATCH 2/3] [Soundcloud] Updated test suite --- youtube_dl/extractor/soundcloud.py | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dl/extractor/soundcloud.py index d64e2f548..0d6c72902 100644 --- a/youtube_dl/extractor/soundcloud.py +++ b/youtube_dl/extractor/soundcloud.py @@ -136,6 +136,38 @@ class SoundcloudIE(InfoExtractor): 'license': 'all-rights-reserved', }, }, + # use album art for thumbnail + { + 'url': 'https://soundcloud.com/postmalone/rockstar-feat-21-savage', + 'md5': '631b6b41bdfb5c1e466e207a7afaf3ed', + 'info_dict': { + 'id': '341546259', + 'ext': 'mp3', + 'title': 'rockstar (feat. 21 Savage)', + 'description': None, + 'uploader': 'Post Malone', + 'upload_date': '20170908', + 'duration': 218, + 'thumbnail': 'https://i1.sndcdn.com/artworks-JbxEN7x8VfRc-0-t500x500.jpg', + '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': 'https://i1.sndcdn.com/avatars-000298106657-ogrgmg-t500x500.jpg', + 'license': 'all-rights-reserved', + }, + }, ] _CLIENT_ID = 'c6CU49JDMapyrQo06UxU9xouB9ZVzqCn' From 79e50e455b31e5c17739f376bcb3891d85561af3 Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Thu, 4 Jan 2018 19:05:07 -0600 Subject: [PATCH 3/3] [Soundcloud] Applied requested fixes for PR #15117 --- youtube_dl/extractor/soundcloud.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dl/extractor/soundcloud.py index 0d6c72902..6c9816eef 100644 --- a/youtube_dl/extractor/soundcloud.py +++ b/youtube_dl/extractor/soundcloud.py @@ -136,22 +136,6 @@ class SoundcloudIE(InfoExtractor): 'license': 'all-rights-reserved', }, }, - # use album art for thumbnail - { - 'url': 'https://soundcloud.com/postmalone/rockstar-feat-21-savage', - 'md5': '631b6b41bdfb5c1e466e207a7afaf3ed', - 'info_dict': { - 'id': '341546259', - 'ext': 'mp3', - 'title': 'rockstar (feat. 21 Savage)', - 'description': None, - 'uploader': 'Post Malone', - 'upload_date': '20170908', - 'duration': 218, - 'thumbnail': 'https://i1.sndcdn.com/artworks-JbxEN7x8VfRc-0-t500x500.jpg', - 'license': 'all-rights-reserved', - }, - }, # no album art, use avatar pic for thumbnail { 'url': 'https://soundcloud.com/garyvee/sideways-prod-mad-real', @@ -164,9 +148,12 @@ class SoundcloudIE(InfoExtractor): 'uploader': 'garyvee', 'upload_date': '20170226', 'duration': 207, - 'thumbnail': 'https://i1.sndcdn.com/avatars-000298106657-ogrgmg-t500x500.jpg', + 'thumbnail': r're:https?://.*\.jpg', 'license': 'all-rights-reserved', }, + 'params': { + 'skip_download': True, + }, }, ]