[sexcom] support new-style '/gifs' URLs (#7239)

This commit is contained in:
Mike Fährmann
2025-03-27 20:01:57 +01:00
parent 12327b076e
commit c6bc46f5ba
2 changed files with 24 additions and 4 deletions

View File

@@ -128,18 +128,18 @@ class SexcomPinExtractor(SexcomExtractor):
"""Extractor for a pinned image or video on www.sex.com"""
subcategory = "pin"
directory_fmt = ("{category}",)
pattern = BASE_PATTERN + r"/pin/(\d+)(?!.*#related$)"
pattern = BASE_PATTERN + r"(/(?:pin|\w\w/gifs)/\d+/?)(?!.*#related$)"
example = "https://www.sex.com/pin/12345-TITLE/"
def pins(self):
return ("{}/pin/{}/".format(self.root, self.groups[0]),)
return (self.root + self.groups[0],)
class SexcomRelatedPinExtractor(SexcomPinExtractor):
"""Extractor for related pins on www.sex.com"""
subcategory = "related-pin"
directory_fmt = ("{category}", "related {original_pin[pin_id]}")
pattern = BASE_PATTERN + r"/pin/(\d+).*#related$"
pattern = BASE_PATTERN + r"(/pin/(\d+)/?).*#related$"
example = "https://www.sex.com/pin/12345#related"
def metadata(self):
@@ -148,7 +148,7 @@ class SexcomRelatedPinExtractor(SexcomPinExtractor):
def pins(self):
url = "{}/pin/related?pinId={}&limit=24&offset=0".format(
self.root, self.groups[0])
self.root, self.groups[1])
return self._pagination(url)

View File

@@ -38,6 +38,26 @@ __tests__ = (
{
"#url" : "https://www.sex.com/pin/55435122-ecchi/",
"#comment" : "gif legacy URL",
"#category": ("", "sexcom", "pin"),
"#class" : sexcom.SexcomPinExtractor,
"#urls" : "https://imagex1.sx.cdn.live/images/pinporn/2017/12/07/18760842.gif",
"#sha1_content": "176cc63fa05182cb0438c648230c0f324a5965fe",
"extension": "gif",
"filename" : "18760842",
"pin_id" : 209061,
"title" : "Ecchi",
"type" : "gif",
"url" : "https://imagex1.sx.cdn.live/images/pinporn/2017/12/07/18760842.gif",
"tags" : [
"#Big Tits",
"#Hentai",
],
},
{
"#url" : "https://www.sex.com/en/gifs/209061",
"#comment" : "gif",
"#category": ("", "sexcom", "pin"),
"#class" : sexcom.SexcomPinExtractor,