Skip to content

Instantly share code, notes, and snippets.

@Drezil
Created August 6, 2014 19:58
Show Gist options
  • Save Drezil/495293dbc83ab6cde6ef to your computer and use it in GitHub Desktop.
Save Drezil/495293dbc83ab6cde6ef to your computer and use it in GitHub Desktop.
Little Script to download all Harry Potter and the methods of rationality episodes.
#!/bin/bash
mkdir -p HPMoR
cd HPMoR
for episode in `wget -q -O - http://www.hpmorpodcast.com/?page_id=56 | sed -n -e "s/.*http\(.*\)\\.mp3.*/http\1.mp3/p" | uniq`
do
file="`echo "$episode" | sed -n -e 's/.*\/\([^/].*\)\.mp3.*/\1.mp3/p'`"
if [[ -f "$file" ]]; then
echo "$file exists. Skipping."
else
wget "$episode"
fi
done
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment