[nijie] add 'followed' extractor (#3048)
This commit is contained in:
@@ -1046,13 +1046,13 @@ Consider all sites to be NSFW unless otherwise known.
|
||||
<tr>
|
||||
<td>nijie</td>
|
||||
<td>https://nijie.info/</td>
|
||||
<td>Doujin, Favorites, Feeds, Illustrations, individual Images, Nuita History, User Profiles</td>
|
||||
<td>Doujin, Favorites, Feeds, Followed Users, Illustrations, individual Images, Nuita History, User Profiles</td>
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>horne</td>
|
||||
<td>https://horne.red/</td>
|
||||
<td>Doujin, Favorites, Feeds, Illustrations, individual Images, Nuitas, User Profiles</td>
|
||||
<td>Doujin, Favorites, Feeds, Followeds, Illustrations, individual Images, Nuitas, User Profiles</td>
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -346,6 +346,35 @@ class NijieFeedExtractor(NijieExtractor):
|
||||
return ""
|
||||
|
||||
|
||||
class NijiefollowedExtractor(NijieExtractor):
|
||||
"""Extractor for followed nijie users"""
|
||||
subcategory = "followed"
|
||||
pattern = BASE_PATTERN + r"/like_my\.php"
|
||||
test = (
|
||||
("https://nijie.info/like_my.php"),
|
||||
("https://horne.red/like_my.php"),
|
||||
)
|
||||
|
||||
def items(self):
|
||||
self.login()
|
||||
|
||||
url = self.root + "/like_my.php"
|
||||
params = {"p": 1}
|
||||
data = {"_extractor": NijieUserExtractor}
|
||||
|
||||
while True:
|
||||
page = self.request(url, params=params).text
|
||||
|
||||
for user_id in text.extract_iter(
|
||||
page, '"><a href="/members.php?id=', '"'):
|
||||
user_url = "{}/members.php?id={}".format(self.root, user_id)
|
||||
yield Message.Queue, user_url, data
|
||||
|
||||
if '<a rel="next"' not in page:
|
||||
return
|
||||
params["p"] += 1
|
||||
|
||||
|
||||
class NijieImageExtractor(NijieExtractor):
|
||||
"""Extractor for a nijie work/image"""
|
||||
subcategory = "image"
|
||||
|
||||
@@ -193,6 +193,7 @@ SUBCATEGORY_MAP = {
|
||||
"search": "Favorites, Search Results",
|
||||
},
|
||||
"nijie": {
|
||||
"followed": "Followed Users",
|
||||
"nuita" : "Nuita History",
|
||||
},
|
||||
"pinterest": {
|
||||
|
||||
Reference in New Issue
Block a user