From faf0e31b4e33067b80f292186a39c8da91dbab59 Mon Sep 17 00:00:00 2001 From: Federico Leva Date: Mon, 10 Feb 2020 21:19:01 +0200 Subject: [PATCH] Don't set apfrom in initial allpages request, use suggested continuation Helps with recent MediaWiki versions like 1.31 where variants of "!" can give a bad title error and the continuation wants apcontinue anyway. --- dumpgenerator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dumpgenerator.py b/dumpgenerator.py index 3ba9222..b197fb6 100755 --- a/dumpgenerator.py +++ b/dumpgenerator.py @@ -257,14 +257,14 @@ def getPageTitlesAPI(config={}, session=None): c = 0 print ' Retrieving titles in the namespace %d' % (namespace) - apfrom = '!' + apfrom = '' while apfrom: sys.stderr.write('.') # progress params = { 'action': 'query', 'list': 'allpages', 'apnamespace': namespace, - 'apfrom': apfrom.encode('utf-8'), + 'apfrom': apfrom, 'format': 'json', 'aplimit': 500}