Copyright 2009-2024 Richard Fearn
mythcal is a simple script that synchronizes your MythTV recording schedule to a Google calendar.
Leaving my MythTV server on 24/7 wastes electricity, but I don't want to forget to turn it on to record programmes. I wrote this to make it easy to keep track of upcoming recordings.
Earlier versions of mythcal required you to create a calendar manually, and put
the calendar's ID into a mythcal.conf
configuration file. This is no longer
necessary. mythcal now requires fewer permissions (it no longer requires full
access to all of your calendars), and it creates its own calendar for MythTV
programmes.
If you are upgrading from an earlier version of mythcal, the quickest way to migrate is to do the following:
-
Visit Google Account Security and remove access for mythcal.
-
Delete
mythcal.conf
. This will contain the ID of a calendar that mythcal previously used, but will no longer be able to access (since you created it manually). -
(Optional) Delete the old MythTV calendar from your Google account; mythcal will no longer update this.
-
Follow the "Getting started" instructions below, starting at step 3 (Google account access).
-
Create a new directory somewhere on your MythTV server and copy the script (
mythcal
) into the directory. -
Install the required packages:
-
MythTV Python bindings (
"libmyth-python"
for Ubuntu;"python3-MythTV"
from RPM Fusion free for Fedora). -
pytz (
"python3-tz"
for Ubuntu;"python3-pytz"
for Fedora). -
Google APIs Client Library for Python (
"python3-googleapi"
for Ubuntu;"python3-google-api-client"
for Fedora).
-
-
Give mythcal permission to access your Google account. Run
mythcal --auth
and follow the instructions. -
Run mythcal manually with the
--dry-run
or-n
option. (The first time you run this, a new calendar will be created for MythTV programmes.) This will tell you what's going to be changed in your calendar. -
If everything looks good, set up a cron job which will execute mythcal as often as you like. The command being run should look something like this:
cd /path/to/mythcal/directory && ./mythcal
Thanks to Michael T. Dean and Raymond Wagner for pointing me in the direction of the MythTV Python bindings.