Created
May 20, 2023 09:58
-
-
Save mikaelz/8d1e05f346db115f7474f192e92fbbf5 to your computer and use it in GitHub Desktop.
Wget PDF files after logging into WordPress
This file contains 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
#!/bin/bash | |
# Login | |
wget --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3" \ | |
--save-cookies cookies.txt --keep-session-cookies --no-check-certificate --delete-after \ | |
--post-data="log=REPLACE_WITH_LOGIN&pwd=REPLACE_WITH_PASS&testcookie=1" https://example.com/wp-login.php | |
# Download PDFs | |
wget --mirror --load-cookies cookies.txt --keep-session-cookies --no-check-certificate \ | |
--random-wait -e robots=off -A.pdf --page-requisites --adjust-extension --convert-links --backup-converted --no-parent \ | |
--user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3" \ | |
https://example.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment