[mythtvnz] need help installing epgsnoop
Robin Gilks
g8ecj at gilks.org
Mon Dec 29 09:30:40 GMT 2008
>
> I then expected I would go into Mythtv backend setup and add a new video
> source where I could select epgsnoop. However epgsnoop is not one of the
> available XML grabbers.
epgsnoop gets the data from the satellite in a form that can then be
digested by MythTV - it doesn't actually do anything with it other than
stash it away somewhere!
On my system, I run epgsnoop to grab the scheduling data and put it into a
directory that my web server can access. The MythTV grabber for New
Zealand is called tv_grab_nz-py and that is the thing you select in
mythtv-setup.
This grabber would normally get its data from the net but if you have
epgsnoop running successfully then you can just change the URL in the
script and get it from your own web server (at least, thats what I do!!).
I run epgsnoop from within a script called by the cron.daily job stuff.
The script is mostly down to Hads (who wrote epgsnoop) but since I haven't
seen it on any website, here it is :) Its a bit complex because I get both
Sky and Freeview data and pick the best from each by having a seperate
config-dir for one of them so I can capture data for different channels
--------------------------------------------------------
$ cat epg.sh
#!/bin/bash
LISTINGS_SKY="/tmp/listings-sky-$$.xml"
LISTINGS_FREEVIEW="/tmp/listings-freeview-$$.xml"
LISTINGS_ALL="/tmp/listings-all-$$.xml"
HOME="/home/g8ecj"
PATH=$PATH:/usr/local/bin
WEBDIR="/var/www/localhost/htdocs/stuff"
while [ "`/usr/local/bin/myth_recorder_status 7 8 9`" != 'FREE' ]; do
echo "DVB card is in use by MythTV, sleeping for a bit."
sleep 30m
done
(dvbtune -f 1371000 -s 22500 -p h -m -tone 0 2&> /dev/null &) # Tune to a
sky transponder
/usr/local/bin/epgsnoop --quiet > $LISTINGS_SKY
killall dvbtune 2&> /dev/null
sleep 5 # Sleep so as not to get epg data from last tune. Necessary?
(dvbtune -f 1183000 -s 22500 -p h -m -tone 0 2&> /dev/null &) # Tune to a
freeview transponder
/usr/local/bin/epgsnoop --quiet --config-dir=$HOME/.epgsnoop-freeview >
$LISTINGS_FREEVIEW
killall dvbtune 2&> /dev/null
tv_cat --output $LISTINGS_ALL $LISTINGS_SKY $LISTINGS_FREEVIEW
/bin/gzip $LISTINGS_SKY
/bin/gzip $LISTINGS_FREEVIEW
/bin/gzip $LISTINGS_ALL
# Some moving around of files etc.
mv -f $LISTINGS_ALL.gz $WEBDIR/listings-all.xml.gz
mv -f $LISTINGS_SKY.gz $WEBDIR/listings-sky.xml.gz
mv -f $LISTINGS_FREEVIEW.gz $WEBDIR/listings-freeview.xml.gz
--------------------------------------------------------
and this is the script that makes sure that the tuner card is free (the 7
8 9 above are the virtual tuner numbers on my system - yours are probably
different).
--------------------------------------------------------
$ cat myth_recorder_status
#!/usr/bin/python
import sys
from MythTV import MythTV
if len(sys.argv) < 2:
print "Usage: myth_recorder_status <RECORDER> [<RECORDER> ...]"
sys.exit(2)
m = MythTV()
recorders_that_exist = m.getRecorderList()
res = 'FREE'
for recorder in sys.argv[1:]:
if int(recorder) not in recorders_that_exist:
print 'NOT VALID RECORDER (%s)' % recorder
sys.exit(1)
if m.isRecording(recorder):
res = 'RECORDING'
print res
sys.exit(0)
--------------------------------------------------------
The grabber is run by mythbackend at a time you specify - just make sure
its well past the time that epgsnoop runs under cron so that it has fresh
files to work with!!
--
Robin Gilks
More information about the mythtvnz
mailing list