initial
authorfrrobert2 <frrobert@stnectarios.org>
Thu, 29 Apr 2021 20:53:53 +0000 (16:53 -0400)
committerfrrobert2 <frrobert@stnectarios.org>
Thu, 29 Apr 2021 20:53:53 +0000 (16:53 -0400)
README.md [new file with mode: 0644]
bashpodder [new file with mode: 0755]
bp.conf [new file with mode: 0644]
parse_enclosure.xsl [new file with mode: 0644]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..bd71979
--- /dev/null
+++ b/README.md
@@ -0,0 +1,68 @@
+Original Text Taken from http://lincgeek.org/bashpodder/
+
+BashPodder Was written and is maintained here by me (Linc) with the generous code contributions and great ideas of many of its users, some of whom have contributed modified scripts of their own. BashPodder is currently licensed under the GPL. BashPodder was written to be small and fast, and most importantly, to conform to the KISS rule (Keep It Simple Stupid). That way, anyone can add to and detract from the script to suit their own needs (and they are welcome to do so). BashPodder is listed in many places as a "Linux" podcatching client, and in fact, that is what I wrote it for initially, however, it should be noted that I have dozens of emails telling me how well it works on everything else, including but not limited to MaxOSX, Solaris, AIX, Net Open and FreeBSD, even windows and many other OS's I have forgotten I am sure.
+
+Bashpodder requires you have bash (but I have heard it runs fine under korn as well), wget and sed.
+As a bare minimum, you'll need the following three files:
+bashpodder.shell - The main program
+parse_enclosure.xsl - xsl style sheet to grab enclosure info
+bp.conf - The example podcast config list (containing some of my personal favorites)
+
+# By Linc 10/1/2004
+# Find the latest script at http://lincgeek.org/bashpodder
+# Revision 1.21 12/04/2008 - 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
+# and post your changes to the forum at http://lincgeek.org/lincware
+# I'd appreciate it!
+
+
+End of Original Information
+
+Fork Information
+
+ Changes by Rev. Fr. Robert Bower April 29, 2021
+ Renamed the script executable to bashpodder
+
+ Added a option to skip download but add podcasts to logfile to be used when you are using bash podder with a podcast where you don't want to download all past episodes. Supply nd to bashpodder as an argument and the podcasts will be added to the logfile but not actually downloaded. Remove from the logfile any episodes you want to download and rerun bashpodder without the nd argument.
+
+ Example:
+
+ bashpodder nd 
+ Will not actually download the podcasts but will add them to the log file.  Handy to use when you want bashpodder to get caught up with where you are at in a podcast.
+
+# Make script crontab friendly:
+cd $(dirname $0)
+
+# datadir is the directory you want podcasts saved to:
+datadir=$(date +%Y-%m-%d)
+
+# create datadir if necessary:
+mkdir -p $datadir
+
+# 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=$(xsltproc parse_enclosure.xsl $podcast 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
+               if [[ $1 != "nd" ]]
+               then
+               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"
+               fi
+               fi
+               done
+       done < bp.conf
+# Move dynamically created log file to permanent log file:
+cat podcast.log >> temp.log
+sort temp.log | uniq > podcast.log
+rm temp.log
+# Create an m3u playlist:
+ls $datadir | grep -v m3u > $datadir/podcast.m3u
+
diff --git a/bashpodder b/bashpodder
new file mode 100755 (executable)
index 0000000..1ac22fa
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+# By Linc 10/1/2004
+# Find the latest script at http://lincgeek.org/bashpodder
+# Revision 1.21 12/04/2008 - 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
+# and post your changes to the forum at http://lincgeek.org/lincware
+# I'd appreciate it!
+# Changes by Rev. Fr. Robert Bower April 29, 2021
+# Added a option to skip download but add to logfile
+# to be used when you are using bash podder with a podcast where you don't want to download all past episodes
+# use the nd after bashpodder as an argument and the podcasts will be added to the logfile but not actually downloaded.
+# remove from the logfile any episodes you want to download and rerun bashpodder without the nd argument.
+
+# Make script crontab friendly:
+cd $(dirname $0)
+
+# datadir is the directory you want podcasts saved to:
+datadir=$(date +%Y-%m-%d)
+
+# create datadir if necessary:
+mkdir -p $datadir
+
+# 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=$(xsltproc parse_enclosure.xsl $podcast 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
+               if [[ $1 != "nd" ]]
+               then
+               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"
+               fi
+               fi
+               done
+       done < bp.conf
+# Move dynamically created log file to permanent log file:
+cat podcast.log >> temp.log
+sort temp.log | uniq > podcast.log
+rm temp.log
+# Create an m3u playlist:
+ls $datadir | grep -v m3u > $datadir/podcast.m3u
+
diff --git a/bp.conf b/bp.conf
new file mode 100644 (file)
index 0000000..d8c8777
--- /dev/null
+++ b/bp.conf
@@ -0,0 +1,3 @@
+http://feeds.ancientfaith.com/AllSaintsHomilies
+http://feeds.ancientfaith.com/FromTheAmvon
+http://feeds.ancientfaith.com/TheMorningOffering
diff --git a/parse_enclosure.xsl b/parse_enclosure.xsl
new file mode 100644 (file)
index 0000000..9e6d84d
--- /dev/null
@@ -0,0 +1,10 @@
+<stylesheet version="1.0">
+<output method="text"/>
+<template match="/">
+<apply-templates select="/rss/channel/item/enclosure"/>
+</template>
+<template match="enclosure">
+<value-of select="@url"/>
+<text> </text>
+</template>
+</stylesheet>