diff --git a/gallery_dl/extractor/sexcom.py b/gallery_dl/extractor/sexcom.py index f207a672..47f5489e 100644 --- a/gallery_dl/extractor/sexcom.py +++ b/gallery_dl/extractor/sexcom.py @@ -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) diff --git a/test/results/sexcom.py b/test/results/sexcom.py index d874a740..a3818850 100644 --- a/test/results/sexcom.py +++ b/test/results/sexcom.py @@ -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,