In Pywikibot, I used the delinker.py script. It works really well; I like how it functions, especially the way it generates the edit summary and its speed. However, I encounter errors from time to time, and it takes a long time if we run it on both Commons and a local wiki.
Why don't we save time and memory? I would like to request a feature that utilizes the Category:Pages with missing files. This is a built-in MediaWiki category that is available on all wikis and automatically contains pages with broken files.
Steps to implement:
- Add an option to find the category on the local wiki using Q4989282.
- Only check pages in the main namespace.
- Use the API to get a list of broken/missing files on the article page.
- Check the deletion log of each broken file on both Commons and the local wiki:
- If the file was deleted and doesn’t exist, delink it.
- If the file doesn’t have a deletion log and doesn’t exist, ignore it because it may be uploaded on another wiki (not Wikimedia Commons) but not available on the local wiki. For now, ignoring these files is the better option.
Well, that is it! This way we really save time, memory and all. Thanks!