mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[ie/soundcloud] Adjust format sorting (#9584)
- Adapt to 86a972033e
Authored by: bashonly
This commit is contained in:
parent
86a972033e
commit
a2d0840739
1 changed files with 7 additions and 2 deletions
|
@ -217,6 +217,7 @@ def _extract_info_dict(self, info, full_title=None, secret_token=None, extract_f
|
||||||
'filesize': int_or_none(urlh.headers.get('Content-Length')),
|
'filesize': int_or_none(urlh.headers.get('Content-Length')),
|
||||||
'url': format_url,
|
'url': format_url,
|
||||||
'quality': 10,
|
'quality': 10,
|
||||||
|
'format_note': 'Original',
|
||||||
})
|
})
|
||||||
|
|
||||||
def invalid_url(url):
|
def invalid_url(url):
|
||||||
|
@ -233,9 +234,13 @@ def add_format(f, protocol, is_preview=False):
|
||||||
format_id_list.append(protocol)
|
format_id_list.append(protocol)
|
||||||
ext = f.get('ext')
|
ext = f.get('ext')
|
||||||
if ext == 'aac':
|
if ext == 'aac':
|
||||||
f['abr'] = '256'
|
f.update({
|
||||||
|
'abr': 256,
|
||||||
|
'quality': 5,
|
||||||
|
'format_note': 'Premium',
|
||||||
|
})
|
||||||
for k in ('ext', 'abr'):
|
for k in ('ext', 'abr'):
|
||||||
v = f.get(k)
|
v = str_or_none(f.get(k))
|
||||||
if v:
|
if v:
|
||||||
format_id_list.append(v)
|
format_id_list.append(v)
|
||||||
preview = is_preview or re.search(r'/(?:preview|playlist)/0/30/', f['url'])
|
preview = is_preview or re.search(r'/(?:preview|playlist)/0/30/', f['url'])
|
||||||
|
|
Loading…
Reference in a new issue