mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 15:00:40 -05:00
[extractor/common] Add more subtitle mime types for guess when ext is missing
This commit is contained in:
parent
ce00af8767
commit
5cdefc4625
1 changed files with 7 additions and 2 deletions
|
@ -1144,8 +1144,13 @@ def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'):
|
|||
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,
|
||||
|
|
Loading…
Reference in a new issue