Skip to content

Instantly share code, notes, and snippets.

@j-mcc1993
Last active June 1, 2017 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-mcc1993/731dd59b48b780c9e65b28dc67cdd36e to your computer and use it in GitHub Desktop.
Save j-mcc1993/731dd59b48b780c9e65b28dc67cdd36e to your computer and use it in GitHub Desktop.
################################################################################
################################################################################
## ------------------------------------------------------------------------ ##
## | The PKA podcast downloader! Downloads all the PKA podcasts directly to | ##
## | external drive. | ##
## ------------------------------------------------------------------------ ##
## ------------------------------------------------------------------------ ##
## | | ##
## | ####### ## ## ### ###### | ##
## | ## ## ## ## ## ## ######## | ##
## | ## ## ## ## ## ## ######### | ##
## | ####### ## ## ######### ## # | ##
## | ## ## ## ## ## # # | ##
## | ## ## ## ## ## ###### | ##
## | | ##
## ------------------------------------------------------------------------ ##
################################################################################
#!/bin/bash
###############################################################################
## This script downloads the PKA podcast to a local directory. ##
## ##
## Author: James McCullough ##
## Date: 5/31/17 ##
###############################################################################
cat ~/.header_ascii
cd /Volumes/Hitachi/PKA
# Iterate over episodes and dowload them
i=$1
while [ $i -le $2 ]
do
printf "########################################"
printf "########################################\n"
printf "Getting episode $i download URL...\n"
curl -s https://painkilleralready.podbean.com/e/painkiller-already-$i/ > temp
outer_download=$(grep -o \
'https://www.podbean.com/site/UserDownload/[A-Z0-9]*' temp)
curl -s $outer_download > temp
inner_download=$(grep -o \
'https://painkilleralready.podbean.com/mf/download/.*\.mp3' temp)
printf "Downloading episode $i...\n\n"
curl -o PKA_$i.mp3 -L $inner_download
printf "Episode downloaded.\n\n"
printf "########################################"
printf "########################################\n"
i=$[i+1]
done
rm temp
cd ~
printf "Finished.\n"
afplay /System/Library/Sounds/Glass.aiff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment