mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-22 10:11:52 +00:00
[discoverygo] correct ttml subtitle extension
This commit is contained in:
parent
498a8a4ca5
commit
c402e7f3a0
1 changed files with 6 additions and 1 deletions
|
@ -5,6 +5,7 @@ import re
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import compat_str
|
from ..compat import compat_str
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
determine_ext,
|
||||||
extract_attributes,
|
extract_attributes,
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
@ -73,7 +74,11 @@ class DiscoveryGoBaseIE(InfoExtractor):
|
||||||
not subtitle_url.startswith('http')):
|
not subtitle_url.startswith('http')):
|
||||||
continue
|
continue
|
||||||
lang = caption.get('fileLang', 'en')
|
lang = caption.get('fileLang', 'en')
|
||||||
subtitles.setdefault(lang, []).append({'url': subtitle_url})
|
ext = determine_ext(subtitle_url)
|
||||||
|
subtitles.setdefault(lang, []).append({
|
||||||
|
'url': subtitle_url,
|
||||||
|
'ext': 'ttml' if ext == 'xml' else ext,
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in a new issue