[facebook] Fix format sorting
authorYen Chi Hsuan <yan12125@gmail.com>
Tue, 23 Feb 2016 19:43:24 +0000 (03:43 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Tue, 23 Feb 2016 19:43:24 +0000 (03:43 +0800)
'hd' formats should have higher priorities

youtube_dl/extractor/facebook.py

index d2ff38140fe047c8dde4e91669db38e1975b6b86..6c6c3b1bd460407322aab1f35ddd8e55cefaad17 100644 (file)
@@ -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: