aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/turner.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-07-21 19:08:28 +0700
committerSergey M․ <dstftw@gmail.com>2018-07-21 19:08:28 +0700
commit3052a30d4259b182904e5d2430077039461745bb (patch)
tree90ff37fa326c33aff3ad82cd40a2f3ce856ee65b /youtube_dl/extractor/turner.py
parent4ecf300d13a6503ae80b76e01047b41d86ab4d92 (diff)
Improve URL extraction
Diffstat (limited to 'youtube_dl/extractor/turner.py')
-rw-r--r--youtube_dl/extractor/turner.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/extractor/turner.py b/youtube_dl/extractor/turner.py
index 2b7b0d6e1..4a6cbfbb8 100644
--- a/youtube_dl/extractor/turner.py
+++ b/youtube_dl/extractor/turner.py
@@ -15,6 +15,7 @@ from ..utils import (
update_url_query,
ExtractorError,
strip_or_none,
+ url_or_none,
)
@@ -154,8 +155,8 @@ class TurnerBaseIE(AdobePassIE):
subtitles = {}
for source in video_data.findall('closedCaptions/source'):
for track in source.findall('track'):
- track_url = track.get('url')
- if not isinstance(track_url, compat_str) or track_url.endswith('/big'):
+ track_url = url_or_none(track.get('url'))
+ if not track_url or track_url.endswith('/big'):
continue
lang = track.get('lang') or track.get('label') or 'en'
subtitles.setdefault(lang, []).append({