From 6dc86d19643cf5ba5b761374160834301237dd64 Mon Sep 17 00:00:00 2001 From: Federico Leva Date: Thu, 13 Feb 2020 10:49:29 +0200 Subject: [PATCH] Actually use the next batch from prop=revisions in MediaWiki 1.19 --- dumpgenerator.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dumpgenerator.py b/dumpgenerator.py index ce7b748..a14eb81 100755 --- a/dumpgenerator.py +++ b/dumpgenerator.py @@ -962,14 +962,14 @@ def getXMLRevisions(config={}, session=None, allpages=False): config['http_method'] = "GET" exportrequest = site.api(http_method=config['http_method'], **exportparams) - # The array is called "pages" even if there's only one. - # TODO: we could actually batch titles a bit here if desired. How many? - try: - pages = prequest['query']['pages'] - except KeyError: - raise PageMissingError(title, xml='') # Be ready to iterate if there is continuation. while True: + # The array is called "pages" even if there's only one. + # TODO: we could actually batch titles a bit here if desired. How many? + try: + pages = prequest['query']['pages'] + except KeyError: + raise PageMissingError(title, xml='') # Go through the data we got to build the XML. for pageid in pages: try: