There are about 11K files in Category:License review needed but the generator yields more than 20K files.
# -*- coding: utf-8 -*-
import pywikibot
from pywikibot import pagegenerators
def main():
SITE = pywikibot.Site()
cat = pywikibot.Category(SITE, 'License_review_needed')
gen = pagegenerators.CategorizedPageGenerator(cat)
for count, page in enumerate(gen, start=1):
file_name = page.title()
print("%d - %s" % (count, file_name))
if __name__ == "__main__":
try:
main()
finally:
pywikibot.stopme()Run at https://repl.it/repls/SeashellHilariousActivecell#main.py