Mailing List Archive

epgdiff
Here in New Zealand, we have a number of human readable EPG sources -
"The Listener" and "TV Guide" magazines with weekly listings, the
printed newspapers with daily listings, and various web sites. I get
a copy of "The Listener" and mark up anything new that I might want to
record and once or twice a week I create or edit my MythTV recording
rules to match.

But not all channels have humanly readable EPG, so for some channels I
have to use the MythTV Guide to find new programmes, and that is
extremely difficult. So I decided to write a script to do diffing of
the EPG data to help me find new programmes. The script worked but
had limited flexibility, and could not eliminate from the list any
programmes that already had recording rules in the database. So
eventually I decided to write a proper Python 3 program to do this job
with all the options I wanted. This now seems to be working, so I
have made it available for anyone who would like to try it:

http://www.jsw.gen.nz/mythtv/epgdiff

It will only work with MythTV v31 and above, as it requires Python 3.
Please consider this to be beta software - it has only been tested on
my MythTV system.

root@mypvr:~# epgdiff -h
usage: epgdiff [-h] [-A] [-V] [-a] [-d] [-c CONFIG] [-f] [-i CHANIDS
[CHANIDS ...]] [-n CHANNUMS [CHANNUMS ...]]

MythTV EPG Diff (Version: 0.1)

optional arguments:
-h, --help show this help message and exit
-A, --all-channels
Ignore chanid and channum lists and diff all chanids
that have EPG data
-V, --version
Display the version number and exit
-a, --all Display all new programmes (including those that match
recording rules) - also displays recording status for programmes that
match recording rules
-d, --dump-upcoming
Dump the upcoming recordings data (debug option)
-c CONFIG, --config CONFIG
Location of MythTV config.xml file (default:
/etc/mythtv/config.xml)
-f, --fast Do not fetch the upcoming recordings list, which takes
a long time. This will cause all new programmes to be listed,
regardless of their matching existing recording rules.
-i CHANIDS [CHANIDS ...], --chanids CHANIDS [CHANIDS ...]
Space separated list of chanid values. Can be used with
-n
-n CHANNUMS [CHANNUMS ...], --channums CHANNUMS [CHANNUMS ...]
Space separated list of chanid values. Can be used with
-i

Here is an example of using epgdiff to see all new programmes on
channel 1:

root@mypvr:~# epgdiff -n 1
1001 - 1 - TV ONE - TVNZ 1
Bradley Walsh's The Larkins
Cycling: Tour Of Southland 2021
Infomercials
Religious
3001 - 1 - TV ONE - TVNZ 1

I have two sources for channel 1, one from DVB-T (chanid 1001) and one
from DVB-S (chanid 3001). The DVB-S source has no EPG data as I do
not normally use it (it is SD, the DVB-T version is HD). So epgdiff
found the two chanids for channum 1 and listed the titles of all
programmes that do not appear in the EPG data prior to the current
time, but do exist after the current time, for each of those chanids.

If you look in the source code, near the top there is a section
"Configuration". In there are user changeable settings. In
particular, there are the DEFAULT_CHANNUM_LIST and DEFAULT_CHANID_LIST
settings. If you have a set of channels which you frequently want to
do diffing on, you can list them in those settings and then run
epgdiff without the -i and/or -n options and it will diff the DEFAULT_
channels.

If you find any problems, or have any requests or suggestions, please
let me know.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: epgdiff [ In reply to ]
I've done what's probably more or less the same thing, but in Perl. The
reason for using Perl is that I already had some scripts using
XML::RSS::SimpleGen and that's how I wanted the output delivered. The Perl
script is run via cron once a day. It generates a diff between program and
oldprogram tables, writes that to a local RSS file which is watched via my
TT-RSS installation, then that gets delivered along with other RSS feeds in
a daily digest email sent by TT-RSS (well *most* days, sometimes it doesn't
send the email and despite meaning to look into why that happens, I've
never got around to it yet).

When I see something that looks interesting, I just click the link for an
entry in the digest email and that takes me to the listing page, where I
can select "Find and record one showing of this title" or "Record at any
time on any channel" for the show in MythWeb.

It works well for me, maybe too well, as my MythTV installation only
records from ~20 UK FTA channels and I still end up recording and watching
more TV than I probably should!

I wrote the Perl script because I heard on this list that the MythTV front
end has the same functionality built into it (I don't use it though) and
thought it would be a neat feature to have on my system.

Ian