From 47c7c85f467cf50c74417f1af4379ccf41508a66 Mon Sep 17 00:00:00 2001 From: wankio <31354933+wankio@users.noreply.github.com> Date: Sun, 1 Jun 2025 16:13:17 +0700 Subject: [PATCH] [sexcom] support '/pics/' URLs (#7611) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update sexcom.py For Pics url https://www.sex.com/en/pics/1459016 * reorder 'pattern' * strip '?width=…' query parameter * add test --------- Co-authored-by: Mike Fährmann --- gallery_dl/extractor/sexcom.py | 4 ++-- test/results/sexcom.py | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/sexcom.py b/gallery_dl/extractor/sexcom.py index c42071ab..ef0b0125 100644 --- a/gallery_dl/extractor/sexcom.py +++ b/gallery_dl/extractor/sexcom.py @@ -130,7 +130,7 @@ class SexcomExtractor(Extractor): data = { "_http_headers": {"Referer": response.url}, "type": "gif", - "url": extr(' href="', '"'), + "url": extr(' href="', '"').partition("?")[0], "title": text.unescape(extr("", " Gif | Sex.com<")), "pin_id": text.parse_int(extr( 'rel="canonical" href="', '"').rpartition("/")[2]), @@ -166,7 +166,7 @@ class SexcomPinExtractor(SexcomExtractor): subcategory = "pin" directory_fmt = ("{category}",) pattern = (BASE_PATTERN + - r"(/(?:pin|\w\w/(?:gif|video)s)/\d+/?)(?!.*#related$)") + r"(/(?:\w\w/(?:pic|gif|video)s|pin)/\d+/?)(?!.*#related$)") example = "https://www.sex.com/pin/12345-TITLE/" def pins(self): diff --git a/test/results/sexcom.py b/test/results/sexcom.py index b715407b..6b6faf3e 100644 --- a/test/results/sexcom.py +++ b/test/results/sexcom.py @@ -10,7 +10,7 @@ from gallery_dl.extractor import sexcom __tests__ = ( { "#url" : "https://www.sex.com/pin/21241874-sexy-ecchi-girls-166/", - "#comment" : "picture", + "#comment" : "picture (legacy URL)", "#category": ("", "sexcom", "pin"), "#class" : sexcom.SexcomPinExtractor, "#urls" : "https://imagex1.sx.cdn.live/images/pinporn/2014/08/26/7637609.jpg", @@ -37,9 +37,26 @@ __tests__ = ( ], }, +{ + "#url" : "https://www.sex.com/en/pics/612398", + "#comment" : "picture", + "#category": ("", "sexcom", "pin"), + "#class" : sexcom.SexcomPinExtractor, + "#urls" : "https://imagex1.sx.cdn.live/images/pinporn/2014/08/26/7637609.jpg", + + "date" : "dt:2014-08-26 00:00:00", + "date_url" : "dt:2014-08-26 00:00:00", + "extension": "jpg", + "filename" : "7637609", + "pin_id" : 612398, + "tags" : ["#Hot"], + "title" : "", + "type" : "gif", +}, + { "#url" : "https://www.sex.com/pin/55435122-ecchi/", - "#comment" : "gif legacy URL", + "#comment" : "gif (legacy URL)", "#category": ("", "sexcom", "pin"), "#class" : sexcom.SexcomPinExtractor, "#urls" : "https://imagex1.sx.cdn.live/images/pinporn/2017/12/07/18760842.gif",