Interactive TV-Guide (Python XMLTV)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
smouge Offline
Junior Member
Posts: 18
Joined: Oct 2003
Reputation: 0
Post: #41
but if i put a listing.xml file in that directory, it hangs with the message pleas wait. after rebooting the log shows the following:


Quote:03-09-2004 19:52:04 info -->python initialized<--
03-09-2004 19:52:04 info
03-09-2004 19:52:04 info get url: http://www.xbox-scene.com/xbox1data/xbox-scene.xml
03-09-2004 19:52:04 info detecting dvd-rom media filesystem...
03-09-2004 19:52:04 error detection of dvd-rom media failed.
03-09-2004 19:52:14 info sys:1: deprecationwarning: non-ascii character '\xc6' in file q:\scripts\tv.guide.py on line 253, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
03-09-2004 19:52:14 info html size failed:
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info exceptions.typeerror
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info int() argument must be a string or a number
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info traceback (most recent call last):
03-09-2004 19:52:14 info   file "q:\scripts\tv.guide.py", line 89, in gethtmlsize
03-09-2004 19:52:14 info     size = int(res.getheader("content-length"))
03-09-2004 19:52:14 info typeerror: int() argument must be a string or a number
03-09-2004 19:52:14 info local size is:
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info 1019882
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info sizes differ: retrieving new listing...
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info download failed:
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info exceptions.nameerror
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info global name 'urllib' is not defined
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info traceback (most recent call last):
03-09-2004 19:52:14 info   file "q:\scripts\tv.guide.py", line 67, in downloadlist
03-09-2004 19:52:14 info     urllib.urlretrieve(url, filename)
03-09-2004 19:52:14 info nameerror: global name 'urllib' is not defined
03-09-2004 19:52:14 info traceback (most recent call last):
03-09-2004 19:52:14 info   file "q:\scripts\tv.guide.py", line 590, in ?
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info tvguide = ctvguide()
03-09-2004 19:52:14 info   file "q:\scripts\tv.guide.py", line 317, in
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info self.processxml.processxml()
03-09-2004 19:52:14 info   file "q:\scripts\tv.guide.py", line 145, in processxml
03-09-2004 19:52:14 info
03-09-2004 19:52:14 info channels = split(listing, '<channel ')
03-09-2004 19:52:14 info   file "q:\python\lib\string.py", line 121, in split
03-09-2004 19:52:14 info attributeerror
03-09-2004 19:52:14 info :
03-09-2004 19:52:14 info 'nonetype' object has no attribute 'split'
03-09-2004 19:52:14 info

looks like still something is wrong, looks like it cannnot find urllib Confused
find quote
smouge Offline
Junior Member
Posts: 18
Joined: Oct 2003
Reputation: 0
Post: #42
fixed, working now.

the problem was an incorrect ip addres for the url Sad.

corrected the ip address where to get the listing.xml and works now like a charm.

nevertheless, an improved error handling would be nice (if you have time to do this)
find quote
smouge Offline
Junior Member
Posts: 18
Joined: Oct 2003
Reputation: 0
Post: #43
sorry, cheering to soon.

the above error was not the real error.

the reason it was working was because i had run aqtbrowser before trying tv.guide. and guss what.. aqtbrowser also uses urllib. so it ssems if you run aqtbrowser first, it loads correctly the urllib. if after that you load tv.guide, it will run successfully.

however if you run tv.guide as the first thing after rebooting, tv-guide doesn't run.

i added the line import urllib to the tv.guide.py and now it runs perfectly, alss if you run it as the first script. seems that explicit loading of urllib is necessaryConfused

modify tc.guide. py to make it loook like this:

Quote:# python xmltv "listing.xml" tvguide script by cruent 2004
# version update 0.2: added ftp support and sorted channels
# version update 0.3: added url support, init. dialog

import time, xbmcgui, xbmc
import sys, httplib, traceback

# seems we have to import urllib explicitly Confused
import urllib

from urllib import urlretrieve
from re import search, dotall
from ftplib import ftp
from string import split, replace
from textwrap import fill
from os.path import getsize
from urlparse import urlparse

# want sorted channels

hope this has been of use to some of you
find quote
DanX Offline
Junior Member
Posts: 1
Joined: Sep 2004
Reputation: 0
Post: #44
i always get a blank screen and this in my log-file of the xbmx:

sys:1: deprecationwarning: non-ascii character '\xc6' in file q:\scripts\tv.guide.py on line 256, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
failed to ftp listing.xml
failed to open listing.xml


i can open the listing.xml with my web browser (ftp-server installed) but somehow xbmc can't transfer it Sad
find quote
commio Offline
Junior Member
Posts: 12
Joined: Oct 2004
Reputation: 0
Post: #45
ktd: would u please be able to post ur script when u enter xbmc is auto tranfers the listing.xml to ur xbox via ftp? all this ftp via the script does not work and is way to confusing.

do u need to download perl or something to use xmltv? where abouts is an australian grabber ??
find quote
commio Offline
Junior Member
Posts: 12
Joined: Oct 2004
Reputation: 0
Post: #46
ktd: dont worry i found it thanks.
find quote
jj5768 Offline
Senior Member
Posts: 112
Joined: Mar 2004
Reputation: 0
Post: #47
does anyone use digiguide ? - i noticed on their beta site that version 8.1 now offers a web interface... just wondering if this could be used as a source of data instead of xmltv ??
find quote
mvoosten Offline
Senior Member
Posts: 163
Joined: Oct 2003
Reputation: 0
Post: #48
(jj5768 @ oct. 14 2004,21:40 Wrote:does anyone use digiguide ? - i noticed on their beta site that version 8.1 now offers a web interface... just wondering if this could be used as a source of data instead of xmltv ??
same question for vodio (http://www.vodio.com)... use it to record tv programs and watch it through xbmc through windows share. however would love to see xbmc integration through their site.. i guess python would be the key here..
they also have a web interface and a web program guide.
find quote
Strawp Offline
Member
Posts: 77
Joined: Apr 2004
Reputation: 0
Post: #49
i miss the tv guide from xbmp (but not enough to go back and use it again Tongue ). i've had a little search around on here and noticed a few threads of python scripts to do with tv listings, but wasn't too sure about what they did.

i just want the same functionality as the old xbmp listings guide had - that is it picks up an existing xmltv file and parses it into a nice format.

i already have a schedule running on a server in the house that gets the tv listings, i just need to be able to view them.

which script do i need to download?
find quote
san Offline
Junior Member
Posts: 42
Joined: Jan 2004
Reputation: 0
Post: #50
i haven't used this one myself but it looks like that it fits you needs. get the script from: http://www.based.com/xmltvdaemon/

i dislike the fact that you need a seperate scipt on you server to fetch the xml file. would be nice if the script itself could do that. anyway the one stated above is proberbly what your looking for.

if you need an alternative check:
http://dwl.xboxmediacenter.de/
find quote
Post Reply