aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/podfetch
diff options
context:
space:
mode:
authorNPScript <nathan@reinerweb.ch>2022-04-09 21:22:20 +0200
committerNPScript <nathan@reinerweb.ch>2022-04-09 21:22:20 +0200
commit896c311feb10e947c727a888308dbc7eb71d1ec2 (patch)
treeb6713478d14eb8ea531107c3f399c437db7fd2fb /.local/bin/podfetch
init commit
Diffstat (limited to '.local/bin/podfetch')
-rwxr-xr-x.local/bin/podfetch21
1 files changed, 21 insertions, 0 deletions
diff --git a/.local/bin/podfetch b/.local/bin/podfetch
new file mode 100755
index 0000000..ce8cf6c
--- /dev/null
+++ b/.local/bin/podfetch
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+feeds='Brainpain|https://w8gez1.podcaster.de/Brainpain.rss'
+
+feed=$(printf "$feeds" | column -t -s"|" | dmenu | awk '{print $NF}')
+
+echo "Fetching feed: $feed"
+
+download=$(wget -qO- $feed | grep "<title>\|<enclosure " | tail -n+2 | awk '{$1=$1};1' | tr '\n' ' ' | sed -e "s/\/> /\/>\n/g" | sed -e "s/<title>//g" | sed -e "s/<\/title>//g" | sed -e "s/ <enclosure type.*url=/´/g" | sed -e "s/\/>$//g" | column -t -s"´" | dmenu)
+
+link=$(echo $download | awk '{print $NF}' | sed -e "s/\"//g")
+name=$(echo $download | sed -e "s/ \".*\"//g")
+filename=$(echo $name | tr ' ' '_')$(echo $link | sed -e "s/.*\././g")
+
+echo "Link: $link"
+echo "Filename: $filename"
+
+notify-send "Downloading Podcast" "$name"
+
+wget -O "/mnt/data/Podcasts/$filename" "$link" && notify-send "Finished Downloading Podcast" "$name" || notify-send "Download Failed" "$name"
+