[sexcom] support '/pics/' URLs (#7611)
* 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 <mike_faehrmann@web.de>
This commit is contained in:
@@ -130,7 +130,7 @@ class SexcomExtractor(Extractor):
|
|||||||
data = {
|
data = {
|
||||||
"_http_headers": {"Referer": response.url},
|
"_http_headers": {"Referer": response.url},
|
||||||
"type": "gif",
|
"type": "gif",
|
||||||
"url": extr(' href="', '"'),
|
"url": extr(' href="', '"').partition("?")[0],
|
||||||
"title": text.unescape(extr("<title>", " Gif | Sex.com<")),
|
"title": text.unescape(extr("<title>", " Gif | Sex.com<")),
|
||||||
"pin_id": text.parse_int(extr(
|
"pin_id": text.parse_int(extr(
|
||||||
'rel="canonical" href="', '"').rpartition("/")[2]),
|
'rel="canonical" href="', '"').rpartition("/")[2]),
|
||||||
@@ -166,7 +166,7 @@ class SexcomPinExtractor(SexcomExtractor):
|
|||||||
subcategory = "pin"
|
subcategory = "pin"
|
||||||
directory_fmt = ("{category}",)
|
directory_fmt = ("{category}",)
|
||||||
pattern = (BASE_PATTERN +
|
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/"
|
example = "https://www.sex.com/pin/12345-TITLE/"
|
||||||
|
|
||||||
def pins(self):
|
def pins(self):
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from gallery_dl.extractor import sexcom
|
|||||||
__tests__ = (
|
__tests__ = (
|
||||||
{
|
{
|
||||||
"#url" : "https://www.sex.com/pin/21241874-sexy-ecchi-girls-166/",
|
"#url" : "https://www.sex.com/pin/21241874-sexy-ecchi-girls-166/",
|
||||||
"#comment" : "picture",
|
"#comment" : "picture (legacy URL)",
|
||||||
"#category": ("", "sexcom", "pin"),
|
"#category": ("", "sexcom", "pin"),
|
||||||
"#class" : sexcom.SexcomPinExtractor,
|
"#class" : sexcom.SexcomPinExtractor,
|
||||||
"#urls" : "https://imagex1.sx.cdn.live/images/pinporn/2014/08/26/7637609.jpg",
|
"#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/",
|
"#url" : "https://www.sex.com/pin/55435122-ecchi/",
|
||||||
"#comment" : "gif legacy URL",
|
"#comment" : "gif (legacy URL)",
|
||||||
"#category": ("", "sexcom", "pin"),
|
"#category": ("", "sexcom", "pin"),
|
||||||
"#class" : sexcom.SexcomPinExtractor,
|
"#class" : sexcom.SexcomPinExtractor,
|
||||||
"#urls" : "https://imagex1.sx.cdn.live/images/pinporn/2017/12/07/18760842.gif",
|
"#urls" : "https://imagex1.sx.cdn.live/images/pinporn/2017/12/07/18760842.gif",
|
||||||
|
|||||||
Reference in New Issue
Block a user