jenkins-bot has submitted this change and it was merged.
Change subject: (Bug 56347) Enable RandomPageGenerator() and site.randompages returning more than 10 pages ......................................................................
(Bug 56347) Enable RandomPageGenerator() and site.randompages returning more than 10 pages
API random list does not return query-continue. We loop the query until we have our total limit exceeded. It is on programmers side to ensure that duplicate pages are filtered (e.g. via DuplicateFilterPageGenerator())
Change-Id: I496e661486afebf5dc681036c73a454c1b4ff367 --- M pywikibot/data/api.py 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 5f36019..9e549c4 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -707,6 +707,10 @@ count += 1 if self.limit > 0 and count >= self.limit: return + if self.module == "random" and self.limit: + # "random" module does not return "query-continue" + # now we loop for a new random query + continue if not "query-continue" in self.data: return if not self.continuekey in self.data["query-continue"]:
pywikibot-commits@lists.wikimedia.org