#!/bin/bash # By Linc 10/1/2004 # Find the latest script at http://linc.homeunix.org:8080/scripts/bashpodder # Last revision 11/17/2004 - Many Contributers! # If you use this and have made improvements or have comments # drop me an email at linc dot fessenden at gmail dot com # I'd appreciate it! # Make script crontab friendly: cd $(dirname $0) # datadir is the directory you want podcasts saved to: datadir=$(date +%Y-%m-%d) # Check for and create datadir if necessary: if test ! -d $datadir then mkdir $datadir fi # Delete any temp file: rm -f temp.log # Read the bp.conf file and wget any url not already in the podcast.log file: while read podcast do file=$(wget -q $podcast -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p') for url in $file do echo $url >> temp.log if ! grep "$url" podcast.log > /dev/null then wget -q -P $datadir "$url" # check to see if the file is a .torrent # then put all the torrents in $datadir/torrent directory if [ "`basename $url`" != "`basename $url .torrent`" ] then mkdir -p $datadir/torrent mv $datadir/`basename $url` $datadir/torrent fi fi done done < bp.conf # check if the torrent directory was created # then launch bt to download the mp3 files if test -d $datadir/torrent then cd $datadir btlaunchmanycurses.py torrent rm torrent/*.torrent cd - fi # Move dynamically created log file to permanent log file: mv temp.log podcast.log # Create an m3u playlist: #ls $datadir | grep -v m3u > $datadir/podcast.m3u