Download images with MediaWiki API?

2019-04-29 17:14发布

Is it possible to download images from Wikipedia with MediaWiki API?

1条回答
神经病院院长
2楼-- · 2019-04-29 18:10

No, it is not possible to get the images via the API. Images in a MediaWiki are stored just in folders, not in a database and are not delivered dynamically (more information on that in the Manual:Image administration).

However, you can retrieve the URLs of those image files via the API. For example see the API:Allimages list or imageinfo property querymodules. Then you can download the files from those URLs with your favourite tool (curl, wget, whatever).

If your question is about downloading all images from Wikipedia, meta:data dumps would be a good start. You also may ask on the data-dump mailing list on how to sync with a repository like Wikimedia Commons.

查看更多
登录 后发表回答