aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/discoverygo.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/discoverygo.py
parent4ecf300d13a6503ae80b76e01047b41d86ab4d92 (diff)
Improve URL extraction
Diffstat (limited to 'youtube_dl/extractor/discoverygo.py')
-rw-r--r--youtube_dl/extractor/discoverygo.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/youtube_dl/extractor/discoverygo.py b/youtube_dl/extractor/discoverygo.py
index 3368c4c07..9e7b14a7d 100644
--- a/youtube_dl/extractor/discoverygo.py
+++ b/youtube_dl/extractor/discoverygo.py
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
import re
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
determine_ext,
extract_attributes,
@@ -12,6 +11,7 @@ from ..utils import (
parse_age_limit,
remove_end,
unescapeHTML,
+ url_or_none,
)
@@ -69,9 +69,8 @@ class DiscoveryGoBaseIE(InfoExtractor):
captions = stream.get('captions')
if isinstance(captions, list):
for caption in captions:
- subtitle_url = caption.get('fileUrl')
- if (not subtitle_url or not isinstance(subtitle_url, compat_str) or
- not subtitle_url.startswith('http')):
+ subtitle_url = url_or_none(caption.get('fileUrl'))
+ if not subtitle_url or not subtitle_url.startswith('http'):
continue
lang = caption.get('fileLang', 'en')
ext = determine_ext(subtitle_url)