![]() |
|
|||||||
| Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only! Not for posting feature requests, bugs, or end-user support requests! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Apr 2004
Posts: 11
![]() |
i think that for the tv guide requests to have any hope of succeeding, the ty guide script needs to be implmented in two parts.
one part is a reusable tv guide display which can be used for all tv guides with language etc. this module will allow the user to select which tv guide they want, time, date, channel lists etc. the other module will be a script which grabs the appropriate tv guide from somewhere. this part needs to be replacable for different areas, and should be easily implemented so that we can get the maximum amount of people implmenting it for their part of the world. possibly it would consist of just a couple of functions that will take a date and time (span?) and retrieve all shows for that time. their might be an info method that would return information on the channels covered and the number of channels eg tvgrabinfo->region = "gotham city" tvgrabinfo->type = "free to air" tvgrabinfo->number = 7 the grabber would return xml with all shows it can get and the time span covered. caching would be nice in the main module. any thoughts from anyone? |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Mar 2004
Posts: 7
![]() |
nlemoz,
i'm currently working on tv guide script that works like this: the first is a daemon written in perl that resides on a linux/windows server, and reads in the xmltv file twice a day. in this way the xmltv file can be acquired as is normal on linux (using whatever script what is available via xmltv.org in a crontab.) the second part is a python plugin frontend for XBMC, which connects to the server and gets all its data from the perl daemon, already nicely parsed. it's almost finished, tvguide works ok, currently testing the recording stuff (you can put items in a recording queue, and the perl deamon will run mencoder at the appropriate time with the apprioprate channel etc.). this will not help for people who don't have a server. maybe someone could run the perl deamon on a public internet server for specific languages/regions for xbox's to connect to via internet (don't know how fast this would be though..) (and disabling the recording option ofcourse .when i think the script is tested ok, and releasable , i'll post i link to the stuff here.dop |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2004
Posts: 174
![]() |
i started a tv guide in python using the listing.xml used in xbmp tv guide.
but i decided to stop it so i may share my work later for people who want to continue it |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2004
Posts: 11
![]() |
for some reason i must have turned reply notification off, so i didn't see your replies until now.
both of these projects sound very interesting. between the last time i checked this forum and now, i made a python script that grabs a tv listing for my area (australia) and prints out xml data to a (windows text) console. i haven't worked out how to make it a module so it could be called from a front-end because this is my first day with python (although i have adequate experience with other languages). i noticed that there is already a perl based xmltv grabber for my area, but i wanted one in python for the xbox so i built it. still needs a bit of error checking and doco, and of course an xbox front end, but we'll see. i would be very interested to see what you guys have so far. maybe you could add an option to run a local (python) xmltv grabber and/or read in a local xml file. |
|
|
|
|
|
#5 | |
|
Junior Member
Join Date: Apr 2004
Posts: 11
![]() |
here's my script for yahoo tv. it still needs some work, for instance:
details grabbing caching more error checking could make the extraction more robust make it more xmltv like noticed before that tabs don't work that well in this bb... had to replace them with spaces. it prints out an xml version of yahoo tv aus for the current time and date. should not take too much work to adapt it to other yahoo regions (eg us etc) Quote:
|
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2004
Posts: 11
![]() |
have written the almost all of the backend, now porting to the xbox (from windows) and writing the gui.
i have a couple of questions: sys.argv[0] doesn't seem to be defined?? if it isn't, how else can i find dircetory that script was launched from? import xml.parsers.expat fails with "no module named pyexpat", do i need to manually add, update from cvs, use a different parser or what? |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2004
Posts: 11
![]() |
found that post by darkie that says he has implemnted pyexpat and added it to cvs.
the post was in feb, but the last python.rar was in jan ![]() must be that anon cvs update issue he was talking about. |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Mar 2004
Posts: 174
![]() |
nlemoz: i tried to use the xml parsers that python normally supports without much luck as well when i started work on my scripts. i ended up writing a quick and dirty parser class using some regular expressions. you're welcome to use it if it will save you some time... you can grab it from the python/lib dir in the archive in this directory. it is called simplexml.py and it has some documentation at the top of the file (run pydoc on it).
|
|
|
|
|
|
#9 | |
|
Team-XBMC Developer
Join Date: Sep 2003
Posts: 530
![]() |
Quote:
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
|
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Apr 2004
Posts: 11
![]() |
a little status update.
i have almost finished an alpha of the tv guide. it now works reasonably well (imho) things to do: allow reordering of channels in display vertical spacing of shows by time/duration to make this whole thing work, i will need to build more listing grabbers. here is a smal spec for a grabber: requirements: can have any name ending in grabber.py must have a function getinfo() that returns a list with a grabber description and channel names eg def getinfo(): return [["aus fta renmark"],["abc","win","sbs"]] must have a function getguide(tv_date, tv_time, sel_channels) which takes a python date(tv_date), an integer indicating the hout in 24 hour format, and a list of strings (taht have been returned from getinfo() ) indicating channels that should be grabbed for this date and time. it must return a text string consisting of xml as follows: <programme channel="win" start="200404060400"> <title>"justice league"</title> </programme> <programme channel="win" start="200404060430"> <title>"good morning america"</title> </programme> <programme channel="sbs" start="200404061250"> <title>"pol pot and the khmer rouge"</title> </programme> where numbers like 200404061250 indicate date and time of the program <span style='color:red'>in gmt</span>. this is very close to the mythtv format, so i am hoping it would be easy to adapt current grabbers. i have avoided specifying that the duration of the show should be in the returned text, as this makes writing the grabber a lot easier. i have also left off the description category, as most grabbers that get all descriptions cause far too many hits on the target website. i may put in an optional field that can be returned that might be used by the guide to get the grabber to retrieve details for one show, but it would be optional. anyway, what do people think, will anybody be interested in coding these for their own region? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Python Development Tools and modules/libraries for XBMC Scripters (outdated) | Alexpoet | Plugin/Script (Python) Development | 10 | 2006-10-03 15:05 |
| Python Development Documentations (outdated) | alx5962 | Plugin/Script (Python) Development | 18 | 2006-06-19 21:53 |
| Python Interpreter Development "Python Inside" | darkie | Plugin/Script (Python) Development | 42 | 2005-09-19 09:07 |
| Dashboard development for .com or possible python | CaVleX | Plugin/Script (Python) Help and Support | 0 | 2005-05-06 18:27 |
| Python Scripts Development | Blackbelt | Plugin/Script (Python) Development | 106 | 2004-04-09 16:12 |