diff options
author | Sergey M․ <dstftw@gmail.com> | 2018-07-21 19:08:28 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2018-07-21 19:08:28 +0700 |
commit | 3052a30d4259b182904e5d2430077039461745bb (patch) | |
tree | 90ff37fa326c33aff3ad82cd40a2f3ce856ee65b /youtube_dl/extractor/xhamster.py | |
parent | 4ecf300d13a6503ae80b76e01047b41d86ab4d92 (diff) |
Improve URL extraction
Diffstat (limited to 'youtube_dl/extractor/xhamster.py')
-rw-r--r-- | youtube_dl/extractor/xhamster.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py index d1bc992fd..68a48034e 100644 --- a/youtube_dl/extractor/xhamster.py +++ b/youtube_dl/extractor/xhamster.py @@ -13,6 +13,7 @@ from ..utils import ( parse_duration, try_get, unified_strdate, + url_or_none, ) @@ -137,7 +138,8 @@ class XHamsterIE(InfoExtractor): else: format_url = format_item filesize = None - if not isinstance(format_url, compat_str): + format_url = url_or_none(format_url) + if not format_url: continue formats.append({ 'format_id': '%s-%s' % (format_id, quality), @@ -198,7 +200,8 @@ class XHamsterIE(InfoExtractor): default='{}'), video_id, fatal=False) for format_id, format_url in sources.items(): - if not isinstance(format_url, compat_str): + format_url = url_or_none(format_url) + if not format_url: continue if format_url in format_urls: continue |