Interactive TV-Guide (Python XMLTV)
#31
Question 
for those in the uk - some dude has written a script to grab/translate/amalgamate bleb.org/tv listings.
pretty handy if you can't be arsed to get xmltv working.
Reply
#32
has anyone here tried o2grabber from
http://www.o2design.se/o2grabber/ ?
Reply
#33
i use it everyday...

do you know swedish? iv written a guide for auto update listing.xml everyday from a ftp or http server...

http://forum.psxcare.com/support/showthread.php?t=14885

i will update it with my http script later today. right now it only update listing.xml via ftp...

i did this cus i couldnt get the update thing in tvguide.py to work...
my script dosent check the filesize, i use the date of the file and if its older then today and after 10am (when mt listing.xml gets updated on my server) i copy it to my xbox when xbmc starts...
Reply
#34
hi all,

i'm having some problems with the script, its not downloading the listing.xml at all, xbmc.log shows the following error :

13-07-2004 21:05:54 -->python initialized<--

13-07-2004 21:05:54

13-07-2004 21:05:54 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

13-07-2004 21:05:54 html size failed:

13-07-2004 21:05:54

13-07-2004 21:05:54 exceptions.typeerror

13-07-2004 21:05:54

13-07-2004 21:05:54 int() argument must be a string or a number

13-07-2004 21:05:54

13-07-2004 21:05:54 traceback (most recent call last):

13-07-2004 21:05:54 file "q:\scripts\tv.guide.py", line 89, in gethtmlsize

13-07-2004 21:05:55 size = int(res.getheader("content-length"))

13-07-2004 21:05:55 typeerror: int() argument must be a string or a number

13-07-2004 21:05:55 getsize() failed:

13-07-2004 21:05:55

13-07-2004 21:05:55 exceptions.oserror

13-07-2004 21:05:55

13-07-2004 21:05:55 [errno 2] no such file or directory: 'q:\\tvguide\\listing.xml'

13-07-2004 21:05:55

13-07-2004 21:05:55 traceback (most recent call last):

13-07-2004 21:05:55 file "q:\scripts\tv.guide.py", line 55, in downloadlist

13-07-2004 21:05:55 file_size = getsize(listing)

13-07-2004 21:05:55 file "q:\python\lib\ntpath.py", line 228, in getsize

13-07-2004 21:05:55 oserror: [errno 2] no such file or directory: 'q:\\tvguide\\listing.xml'

13-07-2004 21:05:55 no listing available
Reply
#35
great script; i've added it to my front page and use it lots.

the sort function doesn't play nice with channel numbers 1-9; my list starts with 10 and 2 comes before 20, etc. is there a way to edit the parsing so that they have front zeros and hence come before channel 10?

also it'd be faboo if we could get it so that the was a selected box that would move around (to get info more easily). then again, i'm not sure it's necessary since its not too hard to move the box you want to the upper left corner.

:thumbsup:

i'm working on prettifying the pngs; will upload them if i get anywhere.
Reply
#36
i just cant get it to work with 0820 cvs.
aqtbrowsers works fine, but this script just doesnt want to start. the code from urk977 to test the download does work Sad
but downloading doesnt work ok with this script.

try http://194.109.6.92/~catwesel/tvguide/listing.xml

it just hangs on please wait....
Reply
#37
anyone with a working grabber for australian tv guides, could you please provide the scripts etc?
Reply
#38
found an australian xml tv grabber.

the script references png files in the tvguide dir, but i dont have them, where can i get these files

the path to images
background = "q:\\tvguide\\background.png"
timebar = "q:\\tvguide\\timebar.png"
blackbar = "q:\\tvguide\\blackbar.png"
titlebox = "q:\\tvguide\\titlebox.png"
descbox = "q:\\tvguide\\descbox.png"
Reply
#39
i have generated an xml file, here is a sample of the file:

<?xml version="1.0" encoding="windows-1252" standalone="yes" ?>
- <tv generator-info-name="auxmltvgrabber/1.0">
- <channel id="free.perth.10">
<display-name lang="en">network ten</display-name>
<icon src="[url]http://d1.com.au/icons/10.png"[/url] />
</channel>
- <programme channel="free.perth.10" start="20040828020000 +1000" stop="20040828040000 +1000">
<title>home shopping</title>
<desc>(g)</desc>
<category>shopping</category>
<rating system="aba">g</rating>
</programme>


i run the tvguide python script in xbmc and everything seems to work ok, but i just get a blank screen with times along the top, but no tv guide info. is the xml file contain correct information or am i missing something?
Reply
#40
i'm getting the following error:

Quote:03-09-2004 19:45:49 notice running the application...
03-09-2004 19:45:49 info -->python initialized<--
03-09-2004 19:45:49 info
03-09-2004 19:45:49 info get url: http://www.xbox-scene.com/xbox1data/xbox-scene.xml
03-09-2004 19:45:49 info detecting dvd-rom media filesystem...
03-09-2004 19:45:49 error detection of dvd-rom media failed.
03-09-2004 19:45:57 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:45:58 info html size failed:
03-09-2004 19:45:58 info
03-09-2004 19:45:58 info exceptions.typeerror
03-09-2004 19:45:58 info
03-09-2004 19:45:58 info int() argument must be a string or a number
03-09-2004 19:45:58 info
03-09-2004 19:45:58 info traceback (most recent call last):
03-09-2004 19:45:58 info   file "q:\scripts\tv.guide.py", line 89, in gethtmlsize
03-09-2004 19:45:58 info     size = int(res.getheader("content-length"))
03-09-2004 19:45:58 info typeerror: int() argument must be a string or a number
03-09-2004 19:45:58 info getsize() failed:
03-09-2004 19:45:58 info
03-09-2004 19:45:58 info exceptions.oserror
03-09-2004 19:45:58 info
03-09-2004 19:45:58 info [errno 2] no such file or directory: 'q:\\tvguide\\listing.xml'
03-09-2004 19:45:58 info
03-09-2004 19:45:58 info traceback (most recent call last):
03-09-2004 19:45:58 info   file "q:\scripts\tv.guide.py", line 55, in downloadlist
03-09-2004 19:45:58 info     file_size = getsize(listing)
03-09-2004 19:45:58 info   file "q:\python\lib\ntpath.py", line 228, in getsize
03-09-2004 19:45:58 info oserror: [errno 2] no such file or directory: 'q:\\tvguide\\listing.xml'
03-09-2004 19:45:58 info no listing available
03-09-2004 19:45:58 info
03-09-2004 19:45:58 info []
03-09-2004 19:45:58 info

it seems that if no listing.xml is available in q:\\tvguide it cannot compare and stops. would be better that in this case the script would just get the file from the url
Reply
#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 Huh
Reply
#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)
Reply
#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 necessaryHuh

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 Huh
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
Reply
#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
Reply
#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 ??
Reply

Logout Mark Read Team Forum Stats Members Help
Interactive TV-Guide (Python XMLTV)0