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.
pull/359/head
Federico Leva 4 years ago
parent 49017e3f20
commit faf0e31b4e

@ -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}

Loading…
Cancel
Save