aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/dctp.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/dctp.py
parent4ecf300d13a6503ae80b76e01047b41d86ab4d92 (diff)
downloadyoutube-dl-3052a30d4259b182904e5d2430077039461745bb.tar.xz
Improve URL extraction
Diffstat (limited to 'youtube_dl/extractor/dctp.py')
-rw-r--r--youtube_dl/extractor/dctp.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/dctp.py b/youtube_dl/extractor/dctp.py
index dc0c41b8a..769a219df 100644
--- a/youtube_dl/extractor/dctp.py
+++ b/youtube_dl/extractor/dctp.py
@@ -7,6 +7,7 @@ from ..utils import (
float_or_none,
int_or_none,
unified_timestamp,
+ url_or_none,
)
@@ -69,7 +70,7 @@ class DctpTvIE(InfoExtractor):
endpoint = next(
server['endpoint']
for server in servers
- if isinstance(server.get('endpoint'), compat_str) and
+ if url_or_none(server.get('endpoint')) and
'cloudfront' in server['endpoint'])
else:
endpoint = 'rtmpe://s2pqqn4u96e4j8.cloudfront.net/cfx/st/'
@@ -92,8 +93,8 @@ class DctpTvIE(InfoExtractor):
for image in images:
if not isinstance(image, dict):
continue
- image_url = image.get('url')
- if not image_url or not isinstance(image_url, compat_str):
+ image_url = url_or_none(image.get('url'))
+ if not image_url:
continue
thumbnails.append({
'url': image_url,