From 167a11938adfbaa34e7615c6d9c04a25a2ec18c4 Mon Sep 17 00:00:00 2001 From: Adam Richard Date: Wed, 17 Jan 2024 11:15:18 -0400 Subject: [PATCH 1/2] Remove warnings about podcast.log not existing on the first run of the program --- bashpodder | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bashpodder b/bashpodder index d95c029..35feb03 100755 --- a/bashpodder +++ b/bashpodder @@ -26,7 +26,7 @@ while read podcast for url in $file do echo $url >> temp.log - if ! grep -F "$url" podcast.log > /dev/null + if ( ! [ -f podcast.log ] ) || ( ! grep -F "$url" podcast.log > /dev/null ) then destination=$datadir/$(echo "$url" | awk -F'/' {'print $NF'} | awk -F'=' {'print $NF'} | awk -F'?' {'print $1'}) wget -t 10 -U BashPodder -c -q -O $destination "$url" || rm $destination @@ -34,7 +34,10 @@ while read podcast done done < bp.conf # Move dynamically created log file to permanent log file: -cat podcast.log >> temp.log +if [ -f podcast.log ] +then + cat podcast.log >> temp.log +fi sort temp.log | uniq > podcast.log rm temp.log # Create an m3u playlist: From 447bf752fba2fca97282d3dda6bf7e13ba0fc2e5 Mon Sep 17 00:00:00 2001 From: Adam Richard Date: Wed, 17 Jan 2024 11:16:46 -0400 Subject: [PATCH 2/2] Update script to use the xsltproc parsing for https RSS feeds --- bashpodder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashpodder b/bashpodder index 35feb03..16a5acb 100755 --- a/bashpodder +++ b/bashpodder @@ -22,7 +22,7 @@ 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') + file=$(wget -q $podcast -O - | xsltproc parse_enclosure.xsl - 2> /dev/null || wget -q $podcast -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p') for url in $file do echo $url >> temp.log