Skip to content

Instantly share code, notes, and snippets.

@pldubouilh
Last active July 17, 2016 15:03
Show Gist options
  • Select an option

  • Save pldubouilh/5400fc1c6baa805b195365b65a8797e7 to your computer and use it in GitHub Desktop.

Select an option

Save pldubouilh/5400fc1c6baa805b195365b65a8797e7 to your computer and use it in GitHub Desktop.
Get your podcasts ready right after their broadcast 👍
# Needs to be in /var/www/html/channel.yml
:title: 'All About Everything'
:description: 'A show about everything'
:url: 'https://www.server.com/data'
# Creates a podcast feed at server.com/feed.xml
# Podcasts will be in server.com/data/*.mp3
# Needs ffmpeg and dropcaster ( gem install dropcaster )
( ffmpeg -i "http://audio.scdn.arkena.com/11008/franceinter-midfi128.mp3" -acodec copy -vcodec copy -metadata title=`date +%D` /var/www/html/f/data/`date +"%s"`.mp3 ) & pid=$!
( sleep 4314 && kill $pid ) 2>/dev/null & watcher=$!
if wait $pid 2>/dev/null; then
echo "finished"
pkill -HUP -P $watcher
wait $watcher
else
sleep 2
find /var/www/html/data/*.mp3 -mtime +10 -exec rm {} \; # Keep only 10
cd /var/www/html && /usr/local/bin/./dropcaster data > feed.xml # Create xml for podcast players
fi
# Wow, so easy to crontab' !
# 50 7 * * * bash /home/user/podcaster.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment