From e16465cb14a748ceaf44df572e1dbbfabe0183a4 Mon Sep 17 00:00:00 2001 From: Jake Finley <86554830+JakeFinley96@users.noreply.github.com> Date: Wed, 1 May 2024 08:12:30 +0300 Subject: [PATCH 1/5] Update xvideos.py --- yt_dlp/extractor/xvideos.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yt_dlp/extractor/xvideos.py b/yt_dlp/extractor/xvideos.py index 59eef8490..0ccb673d7 100644 --- a/yt_dlp/extractor/xvideos.py +++ b/yt_dlp/extractor/xvideos.py @@ -173,20 +173,20 @@ class XVideosIE(InfoExtractor): class XVideosQuickiesIE(InfoExtractor): IE_NAME = 'xvideos:quickies' - _VALID_URL = r'https?://(?P(?:[^/]+\.)?xvideos2?\.com)/amateur-channels/[^#]+#quickies/a/(?P\d+)' + _VALID_URL = r'https?://(?P(?:[^/?#]+\.)?xvideos2?\.com)/(?:profiles/|amateur-channels/)?[^#]+#quickies/a/(?P[a-z0-9]+)' _TESTS = [{ - 'url': 'https://www.xvideos.com/amateur-channels/wifeluna#quickies/a/47258683', - 'md5': '16e322a93282667f1963915568f782c1', + 'url': 'https://www.xvideos.com/lili_love#quickies/a/ipdtikh1a4c', + 'md5': '670235b33d790201f4515fd3604fa236', 'info_dict': { - 'id': '47258683', + 'id': 'ipdtikh1a4c', 'ext': 'mp4', 'title': 'Verification video', 'age_limit': 18, - 'duration': 16, + 'duration': 80, 'thumbnail': r're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg', } }] def _real_extract(self, url): domain, id_ = self._match_valid_url(url).group('domain', 'id') - return self.url_result(f'https://{domain}/video{id_}/_', XVideosIE, id_) + return self.url_result(f'https://{domain}/video.{id_}/_', XVideosIE, id_) From 9dd4660568179348143a75db497d217e6022ef61 Mon Sep 17 00:00:00 2001 From: Jake Finley <86554830+JakeFinley96@users.noreply.github.com> Date: Wed, 1 May 2024 08:47:00 +0300 Subject: [PATCH 2/5] Update xvideos.py Forgot to update title field in test --- yt_dlp/extractor/xvideos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/xvideos.py b/yt_dlp/extractor/xvideos.py index 0ccb673d7..8aa2d6489 100644 --- a/yt_dlp/extractor/xvideos.py +++ b/yt_dlp/extractor/xvideos.py @@ -180,7 +180,7 @@ class XVideosQuickiesIE(InfoExtractor): 'info_dict': { 'id': 'ipdtikh1a4c', 'ext': 'mp4', - 'title': 'Verification video', + 'title': 'Mexican chichóna putisima', 'age_limit': 18, 'duration': 80, 'thumbnail': r're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg', From 743fe3854bbf9499aef16e12997ff34cb1daf127 Mon Sep 17 00:00:00 2001 From: Jake Finley <86554830+JakeFinley96@users.noreply.github.com> Date: Wed, 1 May 2024 17:33:41 +0300 Subject: [PATCH 3/5] Update valid URL to use \w Implements suggested change from pukkandan Co-authored-by: pukkandan --- yt_dlp/extractor/xvideos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/xvideos.py b/yt_dlp/extractor/xvideos.py index 8aa2d6489..1713c95fb 100644 --- a/yt_dlp/extractor/xvideos.py +++ b/yt_dlp/extractor/xvideos.py @@ -173,7 +173,7 @@ class XVideosIE(InfoExtractor): class XVideosQuickiesIE(InfoExtractor): IE_NAME = 'xvideos:quickies' - _VALID_URL = r'https?://(?P(?:[^/?#]+\.)?xvideos2?\.com)/(?:profiles/|amateur-channels/)?[^#]+#quickies/a/(?P[a-z0-9]+)' + _VALID_URL = r'https?://(?P(?:[^/?#]+\.)?xvideos2?\.com)/(?:profiles/|amateur-channels/)?[^#]+#quickies/a/(?P\w+)' _TESTS = [{ 'url': 'https://www.xvideos.com/lili_love#quickies/a/ipdtikh1a4c', 'md5': '670235b33d790201f4515fd3604fa236', From 2824a0c9e7648fd222cb0b020487f569b137596c Mon Sep 17 00:00:00 2001 From: Jake Finley <86554830+JakeFinley96@users.noreply.github.com> Date: Wed, 1 May 2024 17:57:26 +0300 Subject: [PATCH 4/5] Update quickies tests This adds 2 additional tests _(for: profiles/, amateur-channels/)_, and it also fixes the first test which was incorrect... I had ran the test incorrectly so I thought it was passing, but now it is passing correctly. --- yt_dlp/extractor/xvideos.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/xvideos.py b/yt_dlp/extractor/xvideos.py index 1713c95fb..6e53df667 100644 --- a/yt_dlp/extractor/xvideos.py +++ b/yt_dlp/extractor/xvideos.py @@ -176,13 +176,35 @@ class XVideosQuickiesIE(InfoExtractor): _VALID_URL = r'https?://(?P(?:[^/?#]+\.)?xvideos2?\.com)/(?:profiles/|amateur-channels/)?[^#]+#quickies/a/(?P\w+)' _TESTS = [{ 'url': 'https://www.xvideos.com/lili_love#quickies/a/ipdtikh1a4c', - 'md5': '670235b33d790201f4515fd3604fa236', + 'md5': 'f9e4f518ff1de14b99a400bbd0fc5ee0', 'info_dict': { 'id': 'ipdtikh1a4c', 'ext': 'mp4', 'title': 'Mexican chichóna putisima', 'age_limit': 18, - 'duration': 80, + 'duration': 81, + 'thumbnail': r're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg', + } + }, { + 'url': 'https://www.xvideos.com/profiles/lili_love#quickies/a/ipphaob6fd1', + 'md5': '5340938aac6b46e19ebdd1d84535862e', + 'info_dict': { + 'id': 'ipphaob6fd1', + 'ext': 'mp4', + 'title': 'Puta chichona mexicana squirting', + 'age_limit': 18, + 'duration': 56, + 'thumbnail': r're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg', + } + }, { + 'url': 'https://www.xvideos.com/amateur-channels/lili_love#quickies/a/hfmffmd7661', + 'md5': '92428518bbabcb4c513e55922e022491', + 'info_dict': { + 'id': 'hfmffmd7661', + 'ext': 'mp4', + 'title': 'Chichona mexican slut', + 'age_limit': 18, + 'duration': 9, 'thumbnail': r're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg', } }] From 89c0faa9572ef28e909db24101341c887091d42b Mon Sep 17 00:00:00 2001 From: Jake Finley <86554830+JakeFinley96@users.noreply.github.com> Date: Wed, 1 May 2024 18:17:59 +0300 Subject: [PATCH 5/5] Add support for old numeric IDs Seems that the old numeric IDs still work with the old URL format. Since the old numeric IDs no longer show up on the website it would probably be safe to remove them from the extractor, but it wasn't a lot of additional code to add support for them. --- yt_dlp/extractor/xvideos.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/xvideos.py b/yt_dlp/extractor/xvideos.py index 6e53df667..ff8d52b91 100644 --- a/yt_dlp/extractor/xvideos.py +++ b/yt_dlp/extractor/xvideos.py @@ -207,8 +207,19 @@ class XVideosQuickiesIE(InfoExtractor): 'duration': 9, 'thumbnail': r're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg', } + }, { + 'url': 'https://www.xvideos.com/amateur-channels/wifeluna#quickies/a/47258683', + 'md5': '16e322a93282667f1963915568f782c1', + 'info_dict': { + 'id': '47258683', + 'ext': 'mp4', + 'title': 'Verification video', + 'age_limit': 18, + 'duration': 16, + 'thumbnail': r're:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg', + } }] def _real_extract(self, url): domain, id_ = self._match_valid_url(url).group('domain', 'id') - return self.url_result(f'https://{domain}/video.{id_}/_', XVideosIE, id_) + return self.url_result(f'https://{domain}/video{"." if int_or_none(id_) == None else ""}{id_}/_', XVideosIE, id_)