#! /bin/sh
#
# Written by PT for downloading local copies of private Spreaker archives
# Created 04-28-2021
#
#
## Sample Entry for copy and paste. Replace items in ALL CAPS
#
#########
## NAME OF PODCAST
#########
#
## Get the rss file and change the enclosure path to unique local path
#curl RSSURL --create-dirs -o NAME/rss && sed -i 's/https:\/\/api.spreaker.com\/download\/episode\([0-9/]*\)/mp3\//g' NAME/rss
#
## Get the mp3 files and save them to path from above
#curl RSSURL  | grep -o '<enclosure url="[^"]*' | grep -o '[^"]*$' | xargs wget -c --directory-prefix=NAME/mp3
#
#
#########
## Better Health Care Policy
#########
#
## Get the rss file and change the enclosure path to unique local path
curl https://www.spreaker.com/show/2979079/episodes/feed --create-dirs -o archive/bhcp/rss && sed -i 's/https:\/\/api.spreaker.com\/download\/episode\([0-9/]*\)/mp3\//g' archive/bhcp/rss
#
## Get the mp3 files and save them to LOCATION from above
curl https://www.spreaker.com/show/2979079/episodes/feed | grep -o '<enclosure url="[^"]*' | grep -o '[^"]*$' | xargs wget -c --directory-prefix=archive/bhcp/mp3/
