From 13081db1f5e026e8571e4f46758dc947702228f5 Mon Sep 17 00:00:00 2001 From: Sander Date: Sun, 23 Apr 2017 23:49:41 +0200 Subject: [PATCH] [xvideos] Add video duration --- youtube_dl/extractor/xvideos.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index 30825daae9..ce3a05e419 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -8,6 +8,7 @@ clean_html, ExtractorError, determine_ext, + parse_duration, ) @@ -20,6 +21,7 @@ class XVideosIE(InfoExtractor): 'id': '4588838', 'ext': 'mp4', 'title': 'Biker Takes his Girl', + 'duration': 120, 'age_limit': 18, } } @@ -36,6 +38,8 @@ def _real_extract(self, url): r'(.*?)\s+-\s+XVID', webpage, 'title') video_thumbnail = self._search_regex( r'url_bigthumb=(.+?)&', webpage, 'thumbnail', fatal=False) + video_duration = parse_duration(self._search_regex( + r'<span class="duration">.*?(\d[^<]+)', webpage, 'duration', fatal=False)) formats = [] @@ -67,6 +71,7 @@ def _real_extract(self, url): 'id': video_id, 'formats': formats, 'title': video_title, + 'duration': video_duration, 'thumbnail': video_thumbnail, 'age_limit': 18, }