[sexcom] add 'likes' extractor (#6149)
This commit is contained in:
@@ -790,7 +790,7 @@ Consider all listed sites to potentially be NSFW.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>Sex.com</td>
|
<td>Sex.com</td>
|
||||||
<td>https://www.sex.com/</td>
|
<td>https://www.sex.com/</td>
|
||||||
<td>Boards, Pins, User Pins, related Pins, Search Results</td>
|
<td>Boards, Likes, Pins, User Pins, related Pins, Search Results</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -152,6 +152,25 @@ class SexcomPinsExtractor(SexcomExtractor):
|
|||||||
return self._pagination(url)
|
return self._pagination(url)
|
||||||
|
|
||||||
|
|
||||||
|
class SexcomLikesExtractor(SexcomExtractor):
|
||||||
|
"""Extractor for a user's liked pins on www.sex.com"""
|
||||||
|
subcategory = "likes"
|
||||||
|
directory_fmt = ("{category}", "{user}", "Likes")
|
||||||
|
pattern = r"(?:https?://)?(?:www\.)?sex\.com/user/([^/?#]+)/likes/"
|
||||||
|
example = "https://www.sex.com/user/USER/likes/"
|
||||||
|
|
||||||
|
def __init__(self, match):
|
||||||
|
SexcomExtractor.__init__(self, match)
|
||||||
|
self.user = match.group(1)
|
||||||
|
|
||||||
|
def metadata(self):
|
||||||
|
return {"user": text.unquote(self.user)}
|
||||||
|
|
||||||
|
def pins(self):
|
||||||
|
url = "{}/user/{}/likes/".format(self.root, self.user)
|
||||||
|
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"
|
||||||
|
|||||||
@@ -67,14 +67,22 @@ __tests__ = (
|
|||||||
"#url" : "https://www.sex.com/user/sirjuan79/pins/",
|
"#url" : "https://www.sex.com/user/sirjuan79/pins/",
|
||||||
"#category": ("", "sexcom", "pins"),
|
"#category": ("", "sexcom", "pins"),
|
||||||
"#class" : sexcom.SexcomPinsExtractor,
|
"#class" : sexcom.SexcomPinsExtractor,
|
||||||
"#count" : ">= 15",
|
"#count" : ">= 4",
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://www.sex.com/user/sirjuan79/likes/",
|
||||||
|
"#category": ("", "sexcom", "likes"),
|
||||||
|
"#class" : sexcom.SexcomLikesExtractor,
|
||||||
|
"#range" : "1-30",
|
||||||
|
"#count" : ">= 25",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://www.sex.com/user/ronin17/exciting-hentai/",
|
"#url" : "https://www.sex.com/user/ronin17/exciting-hentai/",
|
||||||
"#category": ("", "sexcom", "board"),
|
"#category": ("", "sexcom", "board"),
|
||||||
"#class" : sexcom.SexcomBoardExtractor,
|
"#class" : sexcom.SexcomBoardExtractor,
|
||||||
"#count" : ">= 15",
|
"#count" : ">= 10",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user