Thanks, Jean-Frédéric! I did not know about your tool. I did spend some time looking for a tool on Commons, most specifically here, but didn't find anything appropriate. It did not occur to me to just grep GitHub, though. :)
Anyhow, my tool is on GitHub too, although it's incomplete. The category mode is working fine, but it was originally started (long ago) as a downloader for preparing images for offline Wikipedia editions, based on an article list, and supporting multiple parallel downloaders, and that part is incomplete.
I'll get around to finishing that Some Day Soon.