[inkbunny:following] fix infinite loop

happens when number of watched users is a multiple of 20
This commit is contained in:
Mike Fährmann
2024-07-22 17:59:58 +02:00
parent db9833c28a
commit 3b26748264

View File

@@ -246,14 +246,12 @@ class InkbunnyFollowingExtractor(InkbunnyExtractor):
data = {"_extractor": InkbunnyUserExtractor}
while True:
cnt = 0
for user in text.extract_iter(
page, '<a class="widget_userNameSmall" href="', '"',
page.index('id="changethumboriginal_form"')):
cnt += 1
yield Message.Queue, self.root + user, data
if cnt < 20:
if "<a title='next page' " not in page:
return
params["page"] += 1
page = self.request(url, params=params).text