update with fallback script, web server plan
add license
rename script file and add readme
git clone https://git.sr.ht/~akstuhl/tuner
cd tuner
pipenv install
pipenv run python tuner.py http://example.com/radio.ics [--default http://example.com/audiostream.mp3] [--fallback bash somescript.sh]
location
field.pipenv python tuner.py <your-URL-here>
This is a listening helper that prioritizes tuning in to weekly radio shows via internet radio streams. If you add these shows as repeating events to a web calendar that publishes an iCalendar (.ics) endpoint, for instance a Google calendar, then this script can retrieve them and switch between the streams according to schedule. Here's mine, for example.
This script tries to do as little as possible in passing URLs from the iCalendar file through to the mpv player. While I wrote it with just audio in mind, there are no guard rails against queuing video sources. Just keep in mind it's untested for any of that.
This is a little tool I wrote for myself with the primary goal of catching weekly radio shows that friends produce or that I'm otherwise interested in. The secondary goal was to have a one-click way to start playing interesting audio when I have a moment to listen and don't want to spend time thinking about what to put on. Now I add things to my radio calendar when I hear about them and, when the timing works out, catch them by listening through the tuner script.