Last active
June 1, 2017 06:12
-
-
Save j-mcc1993/731dd59b48b780c9e65b28dc67cdd36e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
################################################################################ | |
## ------------------------------------------------------------------------ ## | |
## | The PKA podcast downloader! Downloads all the PKA podcasts directly to | ## | |
## | external drive. | ## | |
## ------------------------------------------------------------------------ ## | |
## ------------------------------------------------------------------------ ## | |
## | | ## | |
## | ####### ## ## ### ###### | ## | |
## | ## ## ## ## ## ## ######## | ## | |
## | ## ## ## ## ## ## ######### | ## | |
## | ####### ## ## ######### ## # | ## | |
## | ## ## ## ## ## # # | ## | |
## | ## ## ## ## ## ###### | ## | |
## | | ## | |
## ------------------------------------------------------------------------ ## | |
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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