aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/twitch.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/twitch.py
parent4ecf300d13a6503ae80b76e01047b41d86ab4d92 (diff)
Improve URL extraction
Diffstat (limited to 'youtube_dl/extractor/twitch.py')
-rw-r--r--youtube_dl/extractor/twitch.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index e01f11331..89ee44224 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -27,6 +27,7 @@ from ..utils import (
unified_timestamp,
update_url_query,
urlencode_postdata,
+ url_or_none,
urljoin,
)
@@ -663,8 +664,8 @@ class TwitchClipsIE(TwitchBaseIE):
for option in status['quality_options']:
if not isinstance(option, dict):
continue
- source = option.get('source')
- if not source or not isinstance(source, compat_str):
+ source = url_or_none(option.get('source'))
+ if not source:
continue
formats.append({
'url': source,