[common] prefer using mime type over ext for smil subtitle extraction

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)
This commit is contained in:
remitamine 2016-04-01 19:39:02 +01:00
parent 6d628fafca
commit df634be2ed

View file

@ -1335,7 +1335,7 @@ def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'):
if not src or src in urls: if not src or src in urls:
continue continue
urls.append(src) 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 lang = textstream.get('systemLanguage') or textstream.get('systemLanguageName') or textstream.get('lang') or subtitles_lang
subtitles.setdefault(lang, []).append({ subtitles.setdefault(lang, []).append({
'url': src, 'url': src,