Skip to content

Instantly share code, notes, and snippets.

@Avaray
Last active July 23, 2021 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Avaray/36068306b9955797ede790151b6171ac to your computer and use it in GitHub Desktop.
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
#!/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
@Avaray
Copy link
Author

Avaray commented Jul 23, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment