diff options
author | Sergey M․ <dstftw@gmail.com> | 2017-02-10 01:03:35 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2017-02-10 01:03:35 +0700 |
commit | 9150d1eb6936e7f3ad168095f57dc0c8f56d2364 (patch) | |
tree | 53c66aea7e6fd589a35bcf7883472e508bd2644c /youtube_dl/extractor | |
parent | b7f9843bec27d04f66c0656da22137e32fa157ce (diff) |
[xtube] Fix extraction (closes #12023)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/xtube.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/xtube.py b/youtube_dl/extractor/xtube.py index 83bc1fef2..91bae7ee7 100644 --- a/youtube_dl/extractor/xtube.py +++ b/youtube_dl/extractor/xtube.py @@ -60,7 +60,8 @@ class XTubeIE(InfoExtractor): webpage = self._download_webpage(req, display_id) sources = self._parse_json(self._search_regex( - r'sources\s*:\s*({.+?}),', webpage, 'sources'), video_id) + r'(["\'])sources\1\s*:\s*(?P<sources>{.+?}),', + webpage, 'sources', group='sources'), video_id) formats = [] for format_id, format_url in sources.items(): @@ -81,10 +82,10 @@ class XTubeIE(InfoExtractor): r'<span[^>]+class="nickname"[^>]*>([^<]+)'), webpage, 'uploader', fatal=False) duration = parse_duration(self._search_regex( - r'<dt>Runtime:</dt>\s*<dd>([^<]+)</dd>', + r'<dt>Runtime:?</dt>\s*<dd>([^<]+)</dd>', webpage, 'duration', fatal=False)) view_count = str_to_int(self._search_regex( - r'<dt>Views:</dt>\s*<dd>([\d,\.]+)</dd>', + r'<dt>Views:?</dt>\s*<dd>([\d,\.]+)</dd>', webpage, 'view count', fatal=False)) comment_count = str_to_int(self._html_search_regex( r'>Comments? \(([\d,\.]+)\)<', |