From 9822b807060d2412e521673005e3f1bc72204e99 Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Sat, 24 Mar 2018 13:17:28 -0500 Subject: [PATCH 1/4] [XVideos] Correctly set thumbnail image --- youtube_dl/extractor/xvideos.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index 085c8d4f3..8249cda97 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -39,6 +39,20 @@ class XVideosIE(InfoExtractor): }, { 'url': 'http://static-hw.xvideos.com/swf/xv-player.swf?id_video=4588838', 'only_matching': True, + }, { + 'url': 'https://www.xvideos.com/video299069/diesel_sfw_xxx_video', + 'md5': 'c0cec3673a7b74a0ed871945c03ab935', + 'info_dict': { + 'id': '299069', + 'ext': 'mp4', + 'title': 'DIESEL SFW XXX Video', + 'thumbnail': r're:https?://.*\.jpg', + 'duration': 80, + 'age_limit': 18, + }, + 'params': { + 'skip_download': True, + } }] def _real_extract(self, url): @@ -58,7 +72,8 @@ class XVideosIE(InfoExtractor): group='title') or self._og_search_title(webpage) thumbnail = self._search_regex( - r'url_bigthumb=(.+?)&', webpage, 'thumbnail', fatal=False) + r'url_bigthumb=(.+?)&', webpage, 'thumbnail', default=None) or self._search_regex( + r'html5player\.setThumbUrl\(\'(.+?)\'\);', webpage, 'thumbnail', fatal=False) duration = int_or_none(self._og_search_property( 'duration', webpage, default=None)) or parse_duration( self._search_regex( From 414b27619c384b43b28eeada2979ed5f03b7a5cc Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Tue, 27 Mar 2018 15:54:59 -0500 Subject: [PATCH 2/4] [XVideos] Applied requested fixes for PR #15979 --- youtube_dl/extractor/xvideos.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index 8249cda97..4974b545c 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -39,20 +39,6 @@ class XVideosIE(InfoExtractor): }, { 'url': 'http://static-hw.xvideos.com/swf/xv-player.swf?id_video=4588838', 'only_matching': True, - }, { - 'url': 'https://www.xvideos.com/video299069/diesel_sfw_xxx_video', - 'md5': 'c0cec3673a7b74a0ed871945c03ab935', - 'info_dict': { - 'id': '299069', - 'ext': 'mp4', - 'title': 'DIESEL SFW XXX Video', - 'thumbnail': r're:https?://.*\.jpg', - 'duration': 80, - 'age_limit': 18, - }, - 'params': { - 'skip_download': True, - } }] def _real_extract(self, url): @@ -72,8 +58,7 @@ class XVideosIE(InfoExtractor): group='title') or self._og_search_title(webpage) thumbnail = self._search_regex( - r'url_bigthumb=(.+?)&', webpage, 'thumbnail', default=None) or self._search_regex( - r'html5player\.setThumbUrl\(\'(.+?)\'\);', webpage, 'thumbnail', fatal=False) + r'url_bigthumb=(.+?)&|html5player\.setThumbUrl\(\'(.+?)\'\);', webpage, 'thumbnail', fatal=False) duration = int_or_none(self._og_search_property( 'duration', webpage, default=None)) or parse_duration( self._search_regex( From a9dd7c357a45b0948e9f0dc3f370740db5337179 Mon Sep 17 00:00:00 2001 From: Parmjit Virk Date: Wed, 28 Mar 2018 17:46:42 -0500 Subject: [PATCH 3/4] [XVideos] Applied second requested fixes for PR #15979 --- youtube_dl/extractor/xvideos.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index 4974b545c..a5b52f60d 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -58,7 +58,10 @@ class XVideosIE(InfoExtractor): group='title') or self._og_search_title(webpage) thumbnail = self._search_regex( - r'url_bigthumb=(.+?)&|html5player\.setThumbUrl\(\'(.+?)\'\);', webpage, 'thumbnail', fatal=False) + (r'url_bigthumb=(.+?)&', + r'html5player\.setThumbUrl\(\'(.+?)\'\);'), + webpage, 'thumbnail', fatal=False) + duration = int_or_none(self._og_search_property( 'duration', webpage, default=None)) or parse_duration( self._search_regex( From 7be3cb65fc3124c8ef7fa54e9bf15de1735de818 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Sat, 31 Mar 2018 23:45:19 +0700 Subject: [PATCH 4/4] Update xvideos.py --- youtube_dl/extractor/xvideos.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index a5b52f60d..efee95651 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -58,10 +58,9 @@ class XVideosIE(InfoExtractor): group='title') or self._og_search_title(webpage) thumbnail = self._search_regex( - (r'url_bigthumb=(.+?)&', - r'html5player\.setThumbUrl\(\'(.+?)\'\);'), - webpage, 'thumbnail', fatal=False) - + (r'setThumbUrl\(\s*(["\'])(?P(?:(?!\1).)+)\1', + r'url_bigthumb=(?P.+?)&'), + webpage, 'thumbnail', fatal=False, group='thumbnail') duration = int_or_none(self._og_search_property( 'duration', webpage, default=None)) or parse_duration( self._search_regex(