projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ce00af8
)
[extractor/common] Add more subtitle mime types for guess when ext is missing
author
Sergey M․
<dstftw@gmail.com>
Wed, 19 Aug 2015 19:02:50 +0000
(
01:02
+0600)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 19 Aug 2015 19:02:50 +0000
(
01:02
+0600)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index b1af4587025e56c33b38ca294a8fd50beeea9ef5..ce2030d28264eb33b53571c0e53ef24ddac09502 100644
(file)
--- 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')
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,
lang = textstream.get('systemLanguage') or textstream.get('systemLanguageName') or subtitles_lang
subtitles.setdefault(lang, []).append({
'url': src,