Last active
July 23, 2021 17:38
-
-
Save Avaray/36068306b9955797ede790151b6171ac to your computer and use it in GitHub Desktop.
[BASH] Download all MagPi Issues at once (sequentially) // Because official download page is not user friendly
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 | |
TOTAL=$(curl -s "https://www.raspberrypi.org/magpi-issues/" | grep -Eo "\"MagPi[0-9]+.pdf" | wc -l) | |
for issue in $(eval echo {01..$TOTAL}); do | |
[ ! -f "MagPi$issue.pdf" ] && curl -Os "https://www.raspberrypi.org/magpi-issues/MagPi$issue.pdf" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Today I wanted to put some new features into this script and I realised that MagPi changed Download System some time ago (from issue #87). So, this script doesn't work for numbers 87+. Unique ID for download is generated when visiting DL URL for specific issue. I think it's impossible to obtain that unique download ID without visiting that URL (with headless browser for example). If you will CURL/WGET that DL URL, you won't get that ID.