use an .ics calendar to control an audio player
update with fallback script, web server plan
rename script file and add readme


browse  log 



You can also use your local clone with git send-email.

#A tuner script


Requires pipenv and mpv

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]

#How to use

  1. Find a radio show (or bandcamp album, mp3 file, etc. – see listening queue section below) you'd like to tune in to when it's on.
  2. Make an event for the show in a web calendar (e.g. Google calendar). Find a streaming audio URL where you can listen to the show and paste that URL into the event's location field.
  3. Copy your calendar's .ics URL (for a Google calendar, go to the calendar's settings and look under "Integrate calendar" for an "address in iCal format" field).
  4. To start playing audio, paste your .ics URL as an argument to the script in your terminal: pipenv python tuner.py <your-URL-here>

#What it does

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.

#Alternate uses

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.