aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/common.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-08-20 01:02:50 +0600
committerSergey M․ <dstftw@gmail.com>2015-08-20 01:02:50 +0600
commit5cdefc46257802708816e1d4ea7ff5cafe910ff6 (patch)
treec02f2374910627488186e7be39797ef728e048aa /youtube_dl/extractor/common.py
parentce00af87670d47f4dff6ad80e46a29e49cbdfe4f (diff)
downloadyoutube-dl-5cdefc46257802708816e1d4ea7ff5cafe910ff6.tar.xz
[extractor/common] Add more subtitle mime types for guess when ext is missing
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r--youtube_dl/extractor/common.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index b1af45870..ce2030d28 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -1144,8 +1144,13 @@ class InfoExtractor(object):
ext = textstream.get('ext') or determine_ext(src)
if not ext:
type_ = textstream.get('type')
- if type_ == 'text/srt':
- ext = 'srt'
+ SUBTITLES_TYPES = {
+ 'text/vtt': 'vtt',
+ 'text/srt': 'srt',
+ 'application/smptett+xml': 'tt',
+ }
+ if type_ in SUBTITLES_TYPES:
+ ext = SUBTITLES_TYPES[type_]
lang = textstream.get('systemLanguage') or textstream.get('systemLanguageName') or subtitles_lang
subtitles.setdefault(lang, []).append({
'url': src,