]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[common] prefer using mime type over ext for smil subtitle extraction
authorremitamine <remitamine@gmail.com>
Fri, 1 Apr 2016 18:39:02 +0000 (19:39 +0100)
committerremitamine <remitamine@gmail.com>
Fri, 1 Apr 2016 18:47:49 +0000 (19:47 +0100)
the subtitle ext for http://www.cnet.com/videos/download-amazon-prime-movies-and-tv/
is adb_xml while using the mime type it get tt(application/smptett+xml)

youtube_dl/extractor/common.py

index 85ac0400c1e01e160828de9b6805437631cd61aa..94a5838915d9ac800a64e231cb80ba40e242c165 100644 (file)
@@ -1335,7 +1335,7 @@ class InfoExtractor(object):
             if not src or src in urls:
                 continue
             urls.append(src)
-            ext = textstream.get('ext') or determine_ext(src) or mimetype2ext(textstream.get('type'))
+            ext = textstream.get('ext') or mimetype2ext(textstream.get('type')) or determine_ext(src)
             lang = textstream.get('systemLanguage') or textstream.get('systemLanguageName') or textstream.get('lang') or subtitles_lang
             subtitles.setdefault(lang, []).append({
                 'url': src,