url='%s?title=Special:Imagelist&limit=5000&offset=%s'%(config['index'],offset)#5000 overload some servers, but it is needed for sites like this with no next links http://www.memoryarchive.org/en/index.php?title=Special:Imagelist&sort=byname&limit=50&wpIlMatch=
url='%s?title=Special:Imagelist&limit=%d&offset=%s'%(config['index'],limit,offset)#5000 overload some servers, but it is needed for sites like this with no next links http://www.memoryarchive.org/en/index.php?title=Special:Imagelist&sort=byname&limit=50&wpIlMatch=
#print url
raw=urllib.urlopen(url).read()
iflimit>10andre.search(ur'(?i)allowed memory size of \d+ bytes exhausted',raw):# delicated wiki
print'Error: listing %d images in a chunk not possible, trying tiny chunks'%(limit)