(2012-05-07, 22:47)mikles Wrote: (2012-05-07, 20:37)Maniac Wrote: So is the "whatsonindia" codeword integrated into the SuperTV addin or is it just looking up a url similar to whatsonindia?
How would one for instance use epg from the follwing site http://mojtv.hr/m2/tv-program/default.aspx?id=10
Or perhaps http://tvprofil.net/xmltv/
Use the latter and choose the "daily" file.
If you know python or have a basic knowledge of scripting languages, edit the epg.py file inside supertv's installation folder and write a new class similar to the ones who are declared as "class BlablablaEPG(XMLTVEPG)".
Thank you!
Well I have no experiance with python but I am a programmer in .net (C#).
I have come some way in creating a separate class for the epg, but I am having issues with the self.parseTree(b,au) part.
This is the log:
Code:
23:50:06 T:805257216 ERROR: self.parseTree(b,au)
23:50:06 T:805257216 ERROR: File "/var/mobile/Library/Preferences/XBMC/addons/SuperTV/resources/lib/epg.py", line 1022, in parseTree
23:50:06 T:805257216 ERROR: minutes = (int(l.attrib.get('stop').split(' ')[1][-2:])+(int(l.attrib.get('stop').split(' ')[1][1:-2])*60))*(int(l.attrib.get('stop').split(' ')[1][0]+'1'))
23:50:06 T:805257216 ERROR: IndexError
23:50:06 T:805257216 ERROR: :
23:50:06 T:805257216 ERROR: list index out of range
Obviously it is trying to get an index from the .split(' ') that does not exist. This is the xml that I am trying to parse:
http://tvprofil.net/xmltv/data/bht1.ba/2...il.net.xml
In the Start\Stop values there is no space, so it would fail here.
Can someone just explain to me the following lines of codes, what is it trying to do here and why? How can I modify this so that my solution would work.
Code:
minutes = (int(l.attrib.get('stop').split(' ')[1][-2:])+(int(l.attrib.get('stop').split(' ')[1][1:-2])*60))*(int(l.attrib.get('stop').split(' ')[1][0]+'1'))
tzEnd = USTimeZone.FixedOffset(minutes,'XML')
end=datetime.fromtimestamp(time.mktime(time.strptime(l.attrib.get('stop').split(' ')[0], "%Y%m%d%H%M%S"))).replace(tzinfo=tzEnd).astimezone(LocalTimezone)
if end < nowDateTime:
continue
minutes = (int(l.attrib.get('start').split(' ')[1][-2:])+(int(l.attrib.get('start').split(' ')[1][1:-2])*60))*(int(l.attrib.get('start').split(' ')[1][0]+'1'))
tzStart = USTimeZone.FixedOffset(minutes,'XML')
start=datetime.fromtimestamp(time.mktime(time.strptime(l.attrib.get('start').split(' ')[0], "%Y%m%d%H%M%S"))).replace(tzinfo=tzStart).astimezone(LocalTimezone)
Thanks in advance