1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[xvideos] support '/channels/' URLs (#5244)

This commit is contained in:
Mike Fährmann 2024-02-25 22:42:21 +01:00
parent c60ebc6519
commit 13443f40a3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 30 additions and 5 deletions

View File

@ -11,6 +11,9 @@
from .common import GalleryExtractor, Extractor, Message
from .. import text, util
BASE_PATTERN = (r"(?:https?://)?(?:www\.)?xvideos\.com"
r"/(?:profiles|(?:amateur-|model-)?channels)")
class XvideosBase():
"""Base class for xvideos extractors"""
@ -25,9 +28,7 @@ class XvideosGalleryExtractor(XvideosBase, GalleryExtractor):
"{gallery[id]} {gallery[title]}")
filename_fmt = "{category}_{gallery[id]}_{num:>03}.{extension}"
archive_fmt = "{gallery[id]}_{num}"
pattern = (r"(?:https?://)?(?:www\.)?xvideos\.com"
r"/(?:profiles|amateur-channels|model-channels)"
r"/([^/?#]+)/photos/(\d+)")
pattern = BASE_PATTERN + r"/([^/?#]+)/photos/(\d+)"
example = "https://www.xvideos.com/profiles/USER/photos/12345"
def __init__(self, match):
@ -72,8 +73,7 @@ class XvideosUserExtractor(XvideosBase, Extractor):
"""Extractor for user profiles on xvideos.com"""
subcategory = "user"
categorytransfer = True
pattern = (r"(?:https?://)?(?:www\.)?xvideos\.com"
r"/profiles/([^/?#]+)/?(?:#.*)?$")
pattern = BASE_PATTERN + r"/([^/?#]+)/?(?:#.*)?$"
example = "https://www.xvideos.com/profiles/USER"
def __init__(self, match):

View File

@ -41,6 +41,13 @@ __tests__ = (
"#class" : xvideos.XvideosGalleryExtractor,
},
{
"#url" : "https://www.xvideos.com/channels/pervertedcouple/photos/12",
"#comment" : "/channels/ URL (#5244)",
"#category": ("", "xvideos", "gallery"),
"#class" : xvideos.XvideosGalleryExtractor,
},
{
"#url" : "https://www.xvideos.com/profiles/pervertedcouple",
"#category": ("", "xvideos", "user"),
@ -55,4 +62,22 @@ __tests__ = (
"#class" : xvideos.XvideosUserExtractor,
},
{
"#url" : "https://www.xvideos.com/channels/pervertedcouple",
"#category": ("", "xvideos", "user"),
"#class" : xvideos.XvideosUserExtractor,
},
{
"#url" : "https://www.xvideos.com/amateur-channels/pervertedcouple",
"#category": ("", "xvideos", "user"),
"#class" : xvideos.XvideosUserExtractor,
},
{
"#url" : "https://www.xvideos.com/model-channels/pervertedcouple",
"#category": ("", "xvideos", "user"),
"#class" : xvideos.XvideosUserExtractor,
},
)