Last active
March 20, 2020 06:26
-
-
Save ethanpil/78e81c3f0384ba522ed87892a54f1581 to your computer and use it in GitHub Desktop.
Windows Batch to Download Consecutive Files with Wget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ECHO OFF | |
| SetLocal EnableDelayedExpansion | |
| FOR /L %%G IN (1, 1, 465) DO ( | |
| SET num=%%G | |
| REM You can escape ampersands with ^ like this: ^& | |
| wget -x --load-cookies cookies.txt --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" -O !num!.png https://website.com?year=2012^&page=!num!.png | |
| REM Add a delay between each download | |
| TIMEOUT /T 60 /NOBREAK | |
| ) | |
| EndLocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Above example loads cookes as set already from a cookies.txt file.
Can use a command like this save cookies:
wget -qO- --keep-session-cookies --save-cookies cookies.txt --post-data 'user=MYUSER&password=MYPASS' http://www.domain.com/login.phpOr export from chrome in the cookies.txt format (extension)