From 57f04d5817cb3c8c464c480acce98c8d6a41521a Mon Sep 17 00:00:00 2001 From: duhlu <50544976+duhlu@users.noreply.github.com> Date: Sun, 12 May 2019 13:24:42 +0200 Subject: [PATCH] fix metadata extraction for xtube --- youtube_dl/extractor/xtube.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/xtube.py b/youtube_dl/extractor/xtube.py index c6c0b3291..942d728dd 100644 --- a/youtube_dl/extractor/xtube.py +++ b/youtube_dl/extractor/xtube.py @@ -106,16 +106,17 @@ class XTubeIE(InfoExtractor): (r'

\s*(?P[^<]+?)\s*</h1>', r'videoTitle\s*:\s*(["\'])(?P<title>.+?)\1'), webpage, 'title', group='title') description = self._search_regex( - r'</h1>\s*<p>([^<]+)', webpage, 'description', fatal=False) + r'<span class="fullDescription[^"]+">\s*(?P<description>[^<]+)\s*</span>', + webpage, 'description', fatal=False) uploader = self._search_regex( (r'<input[^>]+name="contentOwnerId"[^>]+value="([^"]+)"', r'<span[^>]+class="nickname"[^>]*>([^<]+)'), webpage, 'uploader', fatal=False) duration = parse_duration(self._search_regex( - r'<dt>Runtime:?</dt>\s*<dd>([^<]+)</dd>', + r',"duration":(?P<duration>\d+)(,|})', webpage, 'duration', fatal=False)) view_count = str_to_int(self._search_regex( - r'<dt>Views:?</dt>\s*<dd>([\d,\.]+)</dd>', + (r'<div class="viewsWrapper">\s*<span class="viewsCount">\s*(\d+)\s*views'), webpage, 'view count', fatal=False)) comment_count = str_to_int(self._html_search_regex( r'>Comments? \(([\d,\.]+)\)<',