[mythtv-users] Aus XMLTV grabber

Phill Edwards philledwards at gmail.com
Sat Jun 4 02:43:44 UTC 2005


> On point 2) I have hacked the tuhs script to do what you want (I wanted to
> be able to go back to the other grabber if the tuhs one broke).
> 
> The altered version is attached (tv_grab_au_tuhs).
> 
> The config file you use for my altered version is as follows:
> 
> channels = (('<tuhs channel id>', '<myth xmltv id>'), ...
> 
> That is
> 
> channels = (('ABC2', 'abc2.abc.gov.au'), and so on.
> 
> Note that because my patch is a simple hack the guide data will use the Myth
> XMLTV id as the channel name, but this shouldn't matter if you already have
> the channel names set in the MythTV setup program.

Thanks for that. I've created my config file as follows:

global channels, authinfo
channels = (('ABC
NSW','nsw.abc.gov.au'),('ABC2','abc2.abc.gov.au'),('CHANNEL NINE
SYDNEY','sydney.nine.com.au'),('SBS SYDNEY','sydney.sbs.com.au'),('SBS
NEWS','news.sbs.com.au'),('CHANNEL SEVEN
SYDNEY','sydney.seven.com.au'),('CHANNEL TEN
SYDNEY','sydney.ten.com.au'))
authinfo.add_password(realm, 'minnie.tuhs.org', 'myname', 'mypass')

But when I run your version of the file I get these errors:
[elm|~/.xmltv]$ /usr/local/bin/tv_grab_au_tuhs_joshuaking --days 7
--config-file /home/mythtv/.xmltv/tv_grab_au_tuhs.py.joshuaking
--force-explicit-timezone --output
/home/mythtv/.xmltv/tvlistings_tuhs.xml
Traceback (most recent call last):
  File "/usr/local/bin/tv_grab_au_tuhs_joshuaking", line 296, in ?
    main()
  File "/usr/local/bin/tv_grab_au_tuhs_joshuaking", line 288, in main
    grab()
  File "/usr/local/bin/tv_grab_au_tuhs_joshuaking", line 217, in grab
    grabDayChannel(day, guide_name, display_name)
  File "/usr/local/bin/tv_grab_au_tuhs_joshuaking", line 192, in grabDayChannel
    f = urllib2.urlopen(req)
  File "/usr/lib/python2.3/urllib2.py", line 129, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.3/urllib2.py", line 326, in open
    '_open', req)
  File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.3/urllib2.py", line 901, in http_open
    return self.do_open(httplib.HTTP, req)
  File "/usr/lib/python2.3/urllib2.py", line 895, in do_open
    return self.parent.error('http', req, fp, code, msg, hdrs)
  File "/usr/lib/python2.3/urllib2.py", line 352, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.3/urllib2.py", line 412, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request

Is there something else I need to make this work? I'm on FC3 with ATRPMs.

> As for the patch, I'm using Will's --force-explicit-timezone option instead
> of the patch (I'm running 0.17), and it's working fine here, so give that a
> go first. You'll have to force mythfilldatabase to pass that flag -- you can
> either use the mythfilldatabase --graboptions parameter to pass it, or you
> can use a little script. I've attached the script I use as tv_grab_au.

For this to work do you have to have an environment variable set - is
it TZ or something? Or do you set the offset in mythsetup somewhere?



Will, if you're reading this, we all really appreciate you creating
this. I hope you don't mind me making a couple of further suggestions:

1) As most of us in MythTV land are using the 9MSN grabber it would be
good if the config file could support the "abc2.abc.gov.au" style
channel IDs as it would a) make for easier migration and b) allow
people to flick between the 2 scripts if one site is down for some
reason.

2) I'm wondering whther it might be easier to allow a paranter to be
passed to the script of a time offset, or a value in the config file,
which would then set the correct time in the XML output without
worrying about what version of mythfilldatabase you're running or what
your offset is in mythsetup. The 9MSN grabber handles this via the
config file and it works really well.

Regards,
Phill


More information about the mythtv-users mailing list