3 # Find the latest script at http://lincgeek.org/bashpodder
4 # Revision 1.21 12/04/2008 - Many Contributers!
5 # If you use this and have made improvements or have comments
6 # drop me an email at linc dot fessenden at gmail dot com
7 # and post your changes to the forum at http://lincgeek.org/lincware
9 # Changes by Rev. Fr. Robert Bower April 29, 2021
10 # Added a option to skip download but add to logfile
11 # to be used when you are using bash podder with a podcast where you don't want to download all past episodes
12 # use the nd after bashpodder as an argument and the podcasts will be added to the logfile but not actually downloaded.
13 # remove from the logfile any episodes you want to download and rerun bashpodder without the nd argument.
15 # Make script crontab friendly:
18 # datadir is the directory you want podcasts saved to:
19 datadir=$(date +%Y-%m-%d)
21 # create datadir if necessary:
24 # Delete any temp file:
27 # Read the bp.conf file and wget any url not already in the podcast.log file:
30 file=$(xsltproc parse_enclosure.xsl $podcast 2> /dev/null || wget -q $podcast -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p')
36 if ! grep "$url" podcast.log > /dev/null
38 wget -t 10 -U BashPodder -c -q -O $datadir/$(echo "$url" | awk -F'/' {'print $NF'} | awk -F'=' {'print $NF'} | awk -F'?' {'print $1'}) "$url"
43 # Move dynamically created log file to permanent log file:
44 cat podcast.log >> temp.log
45 sort temp.log | uniq > podcast.log
47 # Create an m3u playlist:
48 ls $datadir | grep -v m3u > $datadir/podcast.m3u