mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-03 08:19:57 +01:00
[facebook] Fix format sorting
'hd' formats should have higher priorities
This commit is contained in:
parent
1b77ee6248
commit
c24883a1c0
@ -212,10 +212,13 @@ def video_data_list2dict(video_data):
|
|||||||
for src_type in ('src', 'src_no_ratelimit'):
|
for src_type in ('src', 'src_no_ratelimit'):
|
||||||
src = f[0].get('%s_%s' % (quality, src_type))
|
src = f[0].get('%s_%s' % (quality, src_type))
|
||||||
if src:
|
if src:
|
||||||
|
preference = -10 if format_id == 'progressive' else 0
|
||||||
|
if quality == 'hd':
|
||||||
|
preference += 5
|
||||||
formats.append({
|
formats.append({
|
||||||
'format_id': '%s_%s_%s' % (format_id, quality, src_type),
|
'format_id': '%s_%s_%s' % (format_id, quality, src_type),
|
||||||
'url': src,
|
'url': src,
|
||||||
'preference': -10 if format_id == 'progressive' else 0,
|
'preference': preference,
|
||||||
})
|
})
|
||||||
dash_manifest = f[0].get('dash_manifest')
|
dash_manifest = f[0].get('dash_manifest')
|
||||||
if dash_manifest:
|
if dash_manifest:
|
||||||
|
Loading…
Reference in New Issue
Block a user