Advertisement
Guest User

Elektor - Magazines

a guest
Sep 21st, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.19 KB | None | 0 0
  1. @echo off
  2.  
  3. set USER=me@domain.com
  4. set PWD=password
  5.  
  6. call :login
  7.  
  8. for /L %%y in (1990,1,2012) do for %%m in (01,02,03,04,05,06,07,09,10,11,12) do call :download %%y %%m
  9. for /L %%y in (2013,1,2016) do for %%m in (01,03,04,05,06,07,09,10,11,12) do call :download %%y %%m
  10.  
  11. goto :eof
  12.  
  13. :login
  14. wget --keep-session-cookies --cookies=on --save-cookies cookies_mag.txt -O login.htm --no-check-certificate --post-data "username=%USER%&password=%PWD%&remember=1" https://www.elektormagazine.fr/account/login
  15. goto :eof
  16.  
  17. :download
  18. echo.
  19. echo ======================= %1 %2 ============================
  20. echo ======================= %1 %2 ============================
  21. echo ======================= %1 %2 ============================
  22. echo.
  23.  
  24. if %2 EQU 12 call :login
  25.                                                                                                                                                                                    
  26. wget --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" -N -I *.pdf -e robots=off --no-check-certificate --load-cookies cookies_mag.txt -p https://www.elektormagazine.fr/files/magazine/%1/magazine/FR%1%2.pdf
  27. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement