aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2020-04-10 17:24:21 +0700
committerSergey M․ <dstftw@gmail.com>2020-04-10 17:26:03 +0700
commit75294a5ed03f4443970478f3f4eac572239cec45 (patch)
tree9611249127f4a16e8b1daddc4a4f38d833cb1043
parentb9e5f872916a7d753ae237459b10622c1c2c3471 (diff)
downloadyoutube-dl-75294a5ed03f4443970478f3f4eac572239cec45.tar.xz
[soundcloud] Improve AAC format extraction (closes #19173, closes #24708)
-rw-r--r--youtube_dl/extractor/soundcloud.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dl/extractor/soundcloud.py
index 02d56184d..422ce1626 100644
--- a/youtube_dl/extractor/soundcloud.py
+++ b/youtube_dl/extractor/soundcloud.py
@@ -246,7 +246,12 @@ class SoundcloudIE(InfoExtractor):
'comment_count': int,
'repost_count': int,
},
- }
+ },
+ {
+ # with AAC HQ format available via OAuth token
+ 'url': 'https://soundcloud.com/wandw/the-chainsmokers-ft-daya-dont-let-me-down-ww-remix-1',
+ 'only_matching': True,
+ },
]
_API_V2_BASE = 'https://api-v2.soundcloud.com/'
@@ -350,7 +355,8 @@ class SoundcloudIE(InfoExtractor):
format_id_list = []
if protocol:
format_id_list.append(protocol)
- if f.get('ext') == 'aac':
+ ext = f.get('ext')
+ if ext == 'aac':
f['abr'] = '256'
for k in ('ext', 'abr'):
v = f.get(k)
@@ -362,9 +368,13 @@ class SoundcloudIE(InfoExtractor):
abr = f.get('abr')
if abr:
f['abr'] = int(abr)
+ if protocol == 'hls':
+ protocol = 'm3u8' if ext == 'aac' else 'm3u8_native'
+ else:
+ protocol = 'http'
f.update({
'format_id': '_'.join(format_id_list),
- 'protocol': 'm3u8_native' if protocol == 'hls' else 'http',
+ 'protocol': protocol,
'preference': -10 if preview else None,
})
formats.append(f)