Commit caeb6a5c authored by Matěj Cepl's avatar Matěj Cepl
Browse files

My chanes to make script working.

parent 5a629876
#!/bin/bash
set -eu
# By Linc 10/1/2004
# Find the latest script at http://lincgeek.org/bashpodder
# Revision 1.21 12/04/2008 - Many Contributers!
......@@ -7,11 +8,13 @@
# and post your changes to the forum at http://lincgeek.org/lincware
# I'd appreciate it!
BP_CONF=${BPSYNC_BP_CONF:-$HOME/.bp.conf}
# Make script crontab friendly:
cd $(dirname $0)
# datadir is the directory you want podcasts saved to:
datadir=$(date +%Y-%m-%d)
datadir=$HOME/.cache/bashpodder/downloads
# create datadir if necessary:
mkdir -p $datadir
......@@ -22,16 +25,21 @@ 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=$(xsltproc parse_enclosure.xsl $podcast 2> /dev/null || wget -q $podcast -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p')
if echo $podcast | grep -s -E '^\s*#' >/dev/null 2>&1 ; then
continue
fi
#file=$(xsltproc parse_enclosure.xsl $podcast 2> /dev/null || wget -q $podcast -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p')
file=$(xsltproc parse_enclosure.xsl $podcast 2> /dev/null | head -n 2)
for url in $file
do
echo $url >> temp.log
if ! grep "$url" podcast.log > /dev/null
then
wget -t 10 -U BashPodder -c -q -O $datadir/$(echo "$url" | awk -F'/' {'print $NF'} | awk -F'=' {'print $NF'} | awk -F'?' {'print $1'}) "$url"
wget --config=/dev/null -t 10 -U BashPodder -c -O $datadir/$(echo "$url" | awk -F'/' {'print $NF'} | awk -F'=' {'print $NF'} | awk -F'?' {'print $1'}) "$url"
fi
done
done < bp.conf
done < $BP_CONF
# Move dynamically created log file to permanent log file:
cat podcast.log >> temp.log
sort temp.log | uniq > podcast.log
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment