[mythtvnz] Python error in mhegepgsnoop

Stephen Worthington stephen_agent at jsw.gen.nz
Thu May 21 15:11:29 BST 2015


On Thu, 21 May 2015 23:34:39 +1200, you wrote:

>
>> Tried updating to 0.6.0 from 0.5.1 and get another error (as well as not
>> tuning).
>>
>>
>> Building XML file: /tmp/list-xxx
>> Traceback (most recent call last):
>>   File "/usr/local/bin/mhegepgsnoop-0.6.0.py", line 1594, in <module>
>>     main()
>>   File "/usr/local/bin/mhegepgsnoop-0.6.0.py", line 795, in main
>>     elif options.clean_titles2:
>> AttributeError: 'Namespace' object has no attribute 'clean_titles2'
>
>Solved one problem - the above error goes away if I use the '-c' clear
>titles option with an empty (default) string on 0.6.0.
>
>With no backend running to tune the card I still need to run something
>like dvbtune in monitor mode to keep the card open?
>
>Something like "dvbtune -f 562000000 -c 0 -m"

This is the script I use for running mhegepgsnoop on the rare occasion
I need it (do_mhegepgsnoop.sh):

#!/bin/bash

# DVB-T multiplex frequency (kHz)
DVB_T_FREQ=594000

# Adapter number of DVB-T card.
ADAPTER=2

# Output file to store the xmltv EPG data.
TEMP_FILE=/tmp/xmltv.xml
OUTPUT_FILE=/var/www/epg/listings-mheg5.xml

PWD=`pwd`

if [ -e "$TEMP_FILE" ] && [ -f "$TEMP_FILE" ] ; then
    rm "$TEMP_FILE"
fi

# Get the MHEG5 EPG data from the DVT-T multiplex.
dvbtune -f $DVB_T_FREQ -qam 64 -gi 16 -cr 3_4 -bw 8 -tm 8 -m -c
$ADAPTER 2>&1 &
DVBTUNE_PID=$!
sleep 1
echo Running mhegepgsnoop.py now
mhegepgsnoop.py -v -zp -d /dev/dvb/adapter${ADAPTER}/demux0 -o
$TEMP_FILE
if [ $? -ne 0 ]; then
    rm $TEMP_FILE
    echo Error: mhegepgsnoop failed!
else
    # Temporary fix for bad <channel id> values in the MHEG5 EPG data.
    sed -f /usr/local/bin/mhegepgsnoop_sed_replacements --in-place
$TEMP_FILE

    mv $TEMP_FILE $OUTPUT_FILE
    chmod a+rw $OUTPUT_FILE
fi
kill $DVBTUNE_PID


and the mhegepgsnoop_sed_replacements file contains:

s/comedy-central.sky.co.nz/tvcentral.freeviewnz.tv/g
s/.sky.co.nz/.freeviewnz.tv/g


The problem that was fixing is likely long gone now - I have not
touched this code since April 2014.

Watch out for word wraps, or download the file from my web server:

  http://www.jsw.gen.nz/mythtv/do_mhegepgsnoop.sh

I am using a modified version of mhegepgsnoop-0.5.2.py - I needed to
ensure that only the DVB-T channels in my database were used for
channel matching, not the DVB-S ones:

root at mypvr:/usr/local/bin# diff mhegepgsnoop-0.5.2.py mhegepgsnoop.py
3c3
< VERSION = '0.5.2'
---
> VERSION = '0.5.2 JSW'
6c6
< Version: 0.5.2
---
> Version: 0.5.2 JSW modified version
95a96
> 0.5.2 JSW Change selects used to get channels from MythTV to only get DVB-T channels.
870c871
<                       dbconn.execute("select callsign, name, xmltvid
from channel")
---
>                       dbconn.execute("select callsign, name, xmltvid from channel c, dtv_multiplex d where c.mplexid is not NULL and c.mplexid = d.mplexid and d.mod_sys != 'DVB-S'")
883c884
<                       f = os.popen("mysql -ss " + mysql_args + " -e
'select callsign, name, xmltvid from channel' mythconverg")
---
>                       f = os.popen('mysql -ss ' + mysql_args + ' -e \'select callsign, name, xmltvid from channel c, dtv_multiplex d where c.mplexid is not NULL and c.mplexid = d.mplexid and d.mod_sys != "DVB-S"\' mythconverg')



More information about the mythtvnz mailing list