[wistia] Prefer original video format above all others
authorPhilipp Hagemeister <phihag@phihag.de>
Wed, 1 Jan 2014 19:23:47 +0000 (20:23 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Wed, 1 Jan 2014 19:23:49 +0000 (20:23 +0100)
We could also set up a formula which would weigh filesize/bitrate and vcodec/acodec (say, 1GB h264 < 3 GB MPEG2 < 2 GB h264), but that would get really messy real soon.

youtube_dl/extractor/common.py
youtube_dl/extractor/wistia.py

index f34d36cb05fb69533a3dd8ed2de722cb6ada9eea..f7247752e0c510367a3ce342546790d6b57ef922 100644 (file)
@@ -69,7 +69,8 @@ class InfoExtractor(object):
                                  download, lower-case.
                                  "http", "https", "rtsp", "rtmp" or so.
                     * preference Order number of this format. If this field is
-                                 present, the formats get sorted by this field.
+                                 present and not None, the formats get sorted
+                                 by this field.
                                  -1 for default (order by other properties),
                                  -2 or smaller for less than default.
     url:            Final video URL.
index 584550455ad8dbf611424ad6606411850dd72d3e..bc31c2e64f22999adf575e60d59bde3d903bb9cc 100644 (file)
@@ -44,6 +44,7 @@ class WistiaIE(InfoExtractor):
                 'height': a['height'],
                 'filesize': a['size'],
                 'ext': a['ext'],
+                'preference': 1 if atype == 'original' else None,
             })
 
         self._sort_formats(formats)