[xvideos] support '/channels/' URLs (#5244)
This commit is contained in:
@@ -11,6 +11,9 @@
|
|||||||
from .common import GalleryExtractor, Extractor, Message
|
from .common import GalleryExtractor, Extractor, Message
|
||||||
from .. import text, util
|
from .. import text, util
|
||||||
|
|
||||||
|
BASE_PATTERN = (r"(?:https?://)?(?:www\.)?xvideos\.com"
|
||||||
|
r"/(?:profiles|(?:amateur-|model-)?channels)")
|
||||||
|
|
||||||
|
|
||||||
class XvideosBase():
|
class XvideosBase():
|
||||||
"""Base class for xvideos extractors"""
|
"""Base class for xvideos extractors"""
|
||||||
@@ -25,9 +28,7 @@ class XvideosGalleryExtractor(XvideosBase, GalleryExtractor):
|
|||||||
"{gallery[id]} {gallery[title]}")
|
"{gallery[id]} {gallery[title]}")
|
||||||
filename_fmt = "{category}_{gallery[id]}_{num:>03}.{extension}"
|
filename_fmt = "{category}_{gallery[id]}_{num:>03}.{extension}"
|
||||||
archive_fmt = "{gallery[id]}_{num}"
|
archive_fmt = "{gallery[id]}_{num}"
|
||||||
pattern = (r"(?:https?://)?(?:www\.)?xvideos\.com"
|
pattern = BASE_PATTERN + r"/([^/?#]+)/photos/(\d+)"
|
||||||
r"/(?:profiles|amateur-channels|model-channels)"
|
|
||||||
r"/([^/?#]+)/photos/(\d+)")
|
|
||||||
example = "https://www.xvideos.com/profiles/USER/photos/12345"
|
example = "https://www.xvideos.com/profiles/USER/photos/12345"
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
@@ -72,8 +73,7 @@ class XvideosUserExtractor(XvideosBase, Extractor):
|
|||||||
"""Extractor for user profiles on xvideos.com"""
|
"""Extractor for user profiles on xvideos.com"""
|
||||||
subcategory = "user"
|
subcategory = "user"
|
||||||
categorytransfer = True
|
categorytransfer = True
|
||||||
pattern = (r"(?:https?://)?(?:www\.)?xvideos\.com"
|
pattern = BASE_PATTERN + r"/([^/?#]+)/?(?:#.*)?$"
|
||||||
r"/profiles/([^/?#]+)/?(?:#.*)?$")
|
|
||||||
example = "https://www.xvideos.com/profiles/USER"
|
example = "https://www.xvideos.com/profiles/USER"
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
|
|||||||
@@ -41,6 +41,13 @@ __tests__ = (
|
|||||||
"#class" : xvideos.XvideosGalleryExtractor,
|
"#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",
|
"#url" : "https://www.xvideos.com/profiles/pervertedcouple",
|
||||||
"#category": ("", "xvideos", "user"),
|
"#category": ("", "xvideos", "user"),
|
||||||
@@ -55,4 +62,22 @@ __tests__ = (
|
|||||||
"#class" : xvideos.XvideosUserExtractor,
|
"#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,
|
||||||
|
},
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user