[nijie] support multi-page image listings
This commit is contained in:
@@ -96,14 +96,19 @@ class NijieUserExtractor(NijieExtractor):
|
|||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
NijieExtractor.__init__(self)
|
NijieExtractor.__init__(self)
|
||||||
self.artist_id = match.group(1)
|
self.artist_id = match.group(1)
|
||||||
self.artist_url = ("https://nijie.info/members_illust.php?id=" +
|
|
||||||
self.artist_id)
|
|
||||||
|
|
||||||
def get_image_ids(self):
|
def get_image_ids(self):
|
||||||
response = self.session.get(self.artist_url)
|
params = {"id": self.artist_id, "p": 1}
|
||||||
if response.status_code == 404:
|
url = "https://nijie.info/members_illust.php"
|
||||||
raise exception.NotFoundError("artist")
|
while True:
|
||||||
return list(text.extract_iter(response.text, ' illust_id="', '"'))
|
response = self.session.get(url, params=params)
|
||||||
|
if response.status_code == 404:
|
||||||
|
raise exception.NotFoundError("artist")
|
||||||
|
ids = list(text.extract_iter(response.text, ' illust_id="', '"'))
|
||||||
|
yield from ids
|
||||||
|
if len(ids) < 48:
|
||||||
|
return
|
||||||
|
params["p"] += 1
|
||||||
|
|
||||||
|
|
||||||
class NijieImageExtractor(NijieExtractor):
|
class NijieImageExtractor(NijieExtractor):
|
||||||
|
|||||||
Reference in New Issue
Block a user