summary refs log tree commit diff
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2016-02-10 22:23:56 +0100
committerremitamine <remitamine@gmail.com>2016-02-10 22:23:56 +0100
commit47d205a6460a696514f6485a516358513ab880b6 (patch)
tree2a05ec33738c90659bd5e653c66f5b9af86870bb
parent80f772c28a3277376620ed7f50308e12437e358d (diff)
downloadyoutube-dl-47d205a6460a696514f6485a516358513ab880b6.tar.gz
youtube-dl-47d205a6460a696514f6485a516358513ab880b6.tar.xz
youtube-dl-47d205a6460a696514f6485a516358513ab880b6.zip
[crackle] improve format sorting
-rw-r--r--youtube_dl/extractor/crackle.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/youtube_dl/extractor/crackle.py b/youtube_dl/extractor/crackle.py
index a478333a2..70f3f14c3 100644
--- a/youtube_dl/extractor/crackle.py
+++ b/youtube_dl/extractor/crackle.py
@@ -49,12 +49,15 @@ class CrackleIE(InfoExtractor):
     def _real_extract(self, url):
         video_id = self._match_id(url)
         item = self._download_xml(
-            'http://legacyweb-us.crackle.com/app/revamp/vidwallcache.aspx?flags=-1&fm=%s' % video_id, video_id).find('i')
+            'http://legacyweb-us.crackle.com/app/revamp/vidwallcache.aspx?flags=-1&fm=%s' % video_id,
+            video_id).find('i')
         title = item.attrib['t']
 
         thumbnail = None
         subtitles = {}
-        formats = self._extract_m3u8_formats('http://content.uplynk.com/ext/%s/%s.m3u8' % (self._UPLYNK_OWNER_ID, video_id), video_id, 'mp4', fatal=None)
+        formats = self._extract_m3u8_formats(
+            'http://content.uplynk.com/ext/%s/%s.m3u8' % (self._UPLYNK_OWNER_ID, video_id),
+            video_id, 'mp4', fatal=None)
         path = item.attrib.get('p')
         if path:
             thumbnail = self._THUMBNAIL_TEMPLATE % path
@@ -76,7 +79,7 @@ class CrackleIE(InfoExtractor):
                         'url': '%s/%s%s_%s.xml' % (self._SUBTITLE_SERVER, path, locale, v),
                         'ext': 'ttml',
                     }]
-        self._sort_formats(formats, ('width', 'height', 'tbr'))
+        self._sort_formats(formats, ('width', 'height', 'tbr', 'format_id'))
 
         return {
             'id': video_id,