Browse Source

[discoverygo] correct ttml subtitle extension

master-ytdl-org
Remita Amine 7 years ago
parent
commit
c402e7f3a0
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      youtube_dl/extractor/discoverygo.py

+ 6
- 1
youtube_dl/extractor/discoverygo.py View File

@ -5,6 +5,7 @@ import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
extract_attributes,
ExtractorError,
int_or_none,
@ -73,7 +74,11 @@ class DiscoveryGoBaseIE(InfoExtractor):
not subtitle_url.startswith('http')):
continue
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 {
'id': video_id,


Loading…
Cancel
Save