[sexcom] add extractor for related pins (#325)
This commit is contained in:
@@ -94,7 +94,7 @@ Sankaku Channel https://chan.sankakucomplex.com/ Pools, Posts, Tag-Searc
|
|||||||
Sankaku Complex https://www.sankakucomplex.com/ Articles, Tag-Searches
|
Sankaku Complex https://www.sankakucomplex.com/ Articles, Tag-Searches
|
||||||
Sen Manga https://raw.senmanga.com/ Chapters
|
Sen Manga https://raw.senmanga.com/ Chapters
|
||||||
Sense-Scans http://sensescans.com/reader/ Chapters, Manga
|
Sense-Scans http://sensescans.com/reader/ Chapters, Manga
|
||||||
Sex.com https://www.sex.com/ Boards, Pins, Search Results
|
Sex.com https://www.sex.com/ Boards, Pins, related Pins, Search Results
|
||||||
Simply Hentai https://www.simply-hentai.com/ Galleries, individual Images, Videos
|
Simply Hentai https://www.simply-hentai.com/ Galleries, individual Images, Videos
|
||||||
SlickPic https://www.slickpic.com/ Images from Users, Albums
|
SlickPic https://www.slickpic.com/ Images from Users, Albums
|
||||||
SlideShare https://www.slideshare.net/ Presentations
|
SlideShare https://www.slideshare.net/ Presentations
|
||||||
|
|||||||
@@ -93,10 +93,10 @@ class SexcomExtractor(Extractor):
|
|||||||
|
|
||||||
|
|
||||||
class SexcomPinExtractor(SexcomExtractor):
|
class SexcomPinExtractor(SexcomExtractor):
|
||||||
"""Extractor a pinned image or video on www.sex.com"""
|
"""Extractor for a pinned image or video on www.sex.com"""
|
||||||
subcategory = "pin"
|
subcategory = "pin"
|
||||||
directory_fmt = ("{category}",)
|
directory_fmt = ("{category}",)
|
||||||
pattern = r"(?:https?://)?(?:www\.)?sex\.com/pin/(\d+)"
|
pattern = r"(?:https?://)?(?:www\.)?sex\.com/pin/(\d+)(?!.*#related$)"
|
||||||
test = (
|
test = (
|
||||||
# picture
|
# picture
|
||||||
("https://www.sex.com/pin/56714360/", {
|
("https://www.sex.com/pin/56714360/", {
|
||||||
@@ -143,6 +143,25 @@ class SexcomPinExtractor(SexcomExtractor):
|
|||||||
return ("{}/pin/{}/".format(self.root, self.pin_id),)
|
return ("{}/pin/{}/".format(self.root, self.pin_id),)
|
||||||
|
|
||||||
|
|
||||||
|
class SexcomRelatedPinExtractor(SexcomPinExtractor):
|
||||||
|
"""Extractor for related pins on www.sex.com"""
|
||||||
|
subcategory = "related-pin"
|
||||||
|
directory_fmt = ("{category}", "related {original_pin[pin_id]}")
|
||||||
|
pattern = r"(?:https?://)?(?:www\.)?sex\.com/pin/(\d+).*#related$"
|
||||||
|
test = ("https://www.sex.com/pin/56714360/#related", {
|
||||||
|
"count": 24,
|
||||||
|
})
|
||||||
|
|
||||||
|
def metadata(self):
|
||||||
|
pin = self._parse_pin(SexcomPinExtractor.pins(self)[0])
|
||||||
|
return {"original_pin": pin}
|
||||||
|
|
||||||
|
def pins(self):
|
||||||
|
url = "{}/pin/related?pinId={}&limit=24&offset=0".format(
|
||||||
|
self.root, self.pin_id)
|
||||||
|
return self._pagination(url)
|
||||||
|
|
||||||
|
|
||||||
class SexcomBoardExtractor(SexcomExtractor):
|
class SexcomBoardExtractor(SexcomExtractor):
|
||||||
"""Extractor for pins from a board on www.sex.com"""
|
"""Extractor for pins from a board on www.sex.com"""
|
||||||
subcategory = "board"
|
subcategory = "board"
|
||||||
|
|||||||
Reference in New Issue
Block a user