Skip to content

Commit

Permalink
automatic update of youtube_dl to newer version (2020.03.24, 75294a5ed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon committed Apr 10, 2020
1 parent 062f634 commit 43aea61
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app/src/main/python/youtube_dl/extractor/soundcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down Expand Up @@ -350,6 +355,9 @@ def add_format(f, protocol, is_preview=False):
format_id_list = []
if protocol:
format_id_list.append(protocol)
ext = f.get('ext')
if ext == 'aac':
f['abr'] = '256'
for k in ('ext', 'abr'):
v = f.get(k)
if v:
Expand All @@ -360,9 +368,13 @@ def add_format(f, protocol, is_preview=False):
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)
Expand Down

0 comments on commit 43aea61

Please sign in to comment.