@ECHO OFF if [%1] EQU [] ( echo Please enter a URL goto End ) echo Getting the webpages for each image file... echo. wget -r -l 1 -e robots=off -w 1 -A gif,jpg,png %1 REM Description: This command downloads all the webpages linked in %1 and puts them in the directory 'commons.wikimedia.org' REM The images we are interested in are linked in the commons.wikimedia.org/wiki/File:* files, so we need to extract the image links from these HTML files. cd .\commons.wikimedia.org\wiki\ echo creating URL file... echo. for %%i in (File*.*) do grep fullImageLink %%i >> ..\..\urls.txt echo extracting the URLs... echo. REM put these sed commands in files... 1> c1.sed echo s/^.*a href="// 1> c2.sed echo s/".*$// REM Le gros travail commence ici type ..\..\urls.txt | sed -f c1.sed | sed -f c2.sed >> ..\..\myurls.txt del c1.sed del c2.sed cd ..\..\ echo "downloading images..." wget -nc -w 1 -e robots=off -P downloaded_wiki_images -i myurls.txt echo Removing temp files... echo Y | rmdir /s commons.wikimedia.org del urls.txt del myurls.txt :End