I created a bash script that automatically downloads podcasts via the wget command. The "Power Scripting Podcast" is used as an example in the script below. Everything in
bold, that has a reference to the right, should be changed based on the podcast you plan to download. If anyone is interested, by all means use it; don't forget to add execute permission,
chmod +x, to the file.
Code:
#! /bin/bash
#SYNOPSIS: Download Get-Scripting Podcast
#-------- Create podcast directory in current directory and
#-------- store all podcast episodes in said directory.
#-------- Remove unnecessary characters from file name.
#NOTES:
#---Author: omegared
#---Location:
#EXAMPLES:
#LINKS: http://powerscripting.wordpress.com/
# Create $PS if does not exists
PS="./PowerScripting/" #<----CHANGE THIS TO NAME OF PODCAST
if [ -d $PS ]; then
echo "$PS exists"; cd $PS
else
mkdir $PS; cd $PS
fi
OUTPUTFILE=Get-PSPodcast-URLS #<----NAME OF FILE WITH LIST OF URLS (location of individual episodes)
#Remove content of $OUTPUTFILE
echo > $OUTPUTFILE
#Add URLs to $OUTPUTFILE for download; change "150" to the first episode; change 170 to last episode you want to download
for (( c=150; c<=170; c++ ))
do
echo "http://traffic.libsyn.com/powerscripting/PSPodcast-$c.mp3" >> $OUTPUTFILE #<---URL OF FIRST EPISODE
done
#Download new files listed in $OUTPUTFILE; skip existing files
wget -nc -i $OUTPUTFILE
#Remove characters after *.mp3 (ex: filename.mp3?sid=367fe...)
for i in *.mp3'?'sid*; do mv -v "$i" "${i%'?'sid*}"; done