Created
May 1, 2016 20:48
-
-
Save georgevanburgh/b988f11219364d9f9a11fd94e298b50f to your computer and use it in GitHub Desktop.
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/sh | |
LATEST_EPISODE=557 | |
parallel --jobs 5 curl -L -O -s https://media.grc.com/sn/sn-{}.mp3 ::: {001..$LATEST_EPISODE} | |
parallel --jobs 20 curl -L -O -s https://www.grc.com/sn/sn-{}.txt ::: {001..$LATEST_EPISODE} | |
dos2unix *.txt | |
for i in `eval echo {001..$LATEST_EPISODE}`; | |
do | |
EPISODE_NAME=$(cat sn-$i.txt | head -n 6 | grep -i "TITLE:" | cut -c 9- | tr -d '\r' | tr -d '\/:*?"<>|') | |
mkdir "SN$i - $EPISODE_NAME"; mv sn-$i.* "$_" | |
done | |
echo "SN$i - $EPISODE_NAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment