[nekohouse] fix pagination (#6871)

use distinct names for URL values
This commit is contained in:
Mike Fährmann
2025-01-24 10:18:52 +01:00
parent 783cb83258
commit f5add4048e
2 changed files with 5 additions and 5 deletions

View File

@@ -104,18 +104,18 @@ class NekohouseUserExtractor(NekohouseExtractor):
def items(self):
service, user_id, _ = self.groups
url = "{}/{}/user/{}".format(self.root, service, user_id)
creator_url = "{}/{}/user/{}".format(self.root, service, user_id)
params = {"o": 0}
data = {"_extractor": NekohousePostExtractor}
while True:
html = self.request(url, params=params).text
html = self.request(creator_url, params=params).text
cnt = 0
for post in text.extract_iter(html, "<article", "</article>"):
cnt += 1
url = self.root + text.extr(post, '<a href="', '"')
yield Message.Queue, url, data
post_url = self.root + text.extr(post, '<a href="', '"')
yield Message.Queue, post_url, data
if cnt < 50:
return

View File

@@ -64,7 +64,7 @@ __tests__ = (
"#url" : "https://nekohouse.su/fantia/user/19235",
"#class" : nekohouse.NekohouseUserExtractor,
"#pattern" : r"https://nekohouse\.su/fantia/user/19235/post/\d+",
"#count" : range(50, 100),
"#count" : range(51, 100),
},
)