瀏覽代碼

[facebook] Fix format sorting

'hd' formats should have higher priorities
Yen Chi Hsuan 9 年之前
父節點
當前提交
c24883a1c0
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      youtube_dl/extractor/facebook.py

+ 4 - 1
youtube_dl/extractor/facebook.py

@@ -212,10 +212,13 @@ class FacebookIE(InfoExtractor):
                 for src_type in ('src', 'src_no_ratelimit'):
                     src = f[0].get('%s_%s' % (quality, src_type))
                     if src:
+                        preference = -10 if format_id == 'progressive' else 0
+                        if quality == 'hd':
+                            preference += 5
                         formats.append({
                             'format_id': '%s_%s_%s' % (format_id, quality, src_type),
                             'url': src,
-                            'preference': -10 if format_id == 'progressive' else 0,
+                            'preference': preference,
                         })
             dash_manifest = f[0].get('dash_manifest')
             if dash_manifest: