Kodi Community Forum

Full Version: Half-finished TV-listings code (XMLTV-GUI)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
update: thanks to enderw for your work on the script and jslawler for your work on the gui!

the script is now working to grab listings for north america. it uses zap2it just like mythtv for those of you who are familiar with it. we need to write an email to zap2it to see about getting a certificate code for xbmc users. if you already have a zap2it account, you can use your existing account, no need to setup a new one. the script does everything for you...you simply launch it and on first run it will prompt you for your username and password, if the correct parameters are supplied, it will save them, if you mess up and enter an incorrect username or password the settings will not save so you will be prompted again the next time you run the script. :d it will then grab the information from zap2it and create your listing.xml and place it properly for you. when you load up the tv guide it will automatically import your listing.xml. when the listing.xml is imported it will check to make sure it is up-to-date, if it is not, the script will automatically be run, and it will do it all for you so you don't have to maintain anything.

this system was planned out and executed very nicely, it still needs some work as far as user settings go (ex. how many days to grab, timezone, etc.), but it is working for the most part. it will be commited to the svn soon for anyone following this project closely. Smile

regards,
los93sol
nice! :o

i'm foaming at the mouth... great job guys!
:d


i'm working on a norwegian parser now (well, i guess most swedes could use it too and possibly others). uses fredag.dagbladet.no/tv as a base. i dunno how soon it will be done though, but it doesn't really matter as there will be some time until the guide is in cvs anyways...
any dev's reading up on this, there is a small debate as to how to "properly" handle grabbing data and if using python scripts is really the best way to do it.

on the plus side, python is generally easier for the masses to help maintain....but at the same time, there are sites that are dedicated to serving data to programs like mythtv that would require little to no maintenance since the sites don't generally change. the issue is finding these sites that are more "dedicated" to grab the data for everyone.

now the reasons for the debate... (keep in mind we would like to see this is cvs at some point)

-python is not currently enabled by default in build.bat
-a python port of the xmltv libs have to be installed
-communication between c++ code and python is a bit "dodgy" in the current code
-limitations of python in general

personally, i think we should do more research and seek the sites that can be used that will not change, at least not without notice or very frequently. then i don't see any problem grabbing data using c++ code. please note that this is my personal opinion and i do understand the issues of maintenance, but feel if properly researched that maintenance will not be an issue.

if any of the official dev's would please take a gander at the current code for the tv guide (svn link is posted earlier in this thread), and comment on it a bit, that would be awesome. it seems this project has reached a point where it is going to need some guidance from the official team, so if you have a bit of time to take a peek.... :d

regards,
los93sol
maybe check out what bigbellybilly has done with mytv script... he is pulling data from zap2it (xml) and parsing it no problem.

also, check out his listings grid screen... very efficient, lots of info, and easy to use.
we are currently doing the same thing as far as using zap2it, but that's not really what we are looking for....we need some official dev response on the issue. :d

i think i may have something figured out with it but need to consult jslawler about it first.

regards,
los93sol
(affini @ july 22 2005,03:51 Wrote:maybe check out what bigbellybilly has done with mytv script... he is pulling data from zap2it (xml) and parsing it no problem
@enderw/los93sol fyi; bigbellybilly has managed to get a certificate code to zap2it for his mytv script, how are you getting along with that?

ps! i'm not a developer so i can't give a deffinit answer to the "python or no python question" but i still think python grabbers is best for now.
los93sol:

ok, this is gonna be blunt, but i don't have time to write too much right now. it's nothing personal, and i think you know that.

-python is not currently enabled by default in build.bat

ok, this is perhaps a real problem, but to be honest, who doesn't run xbmc with python nowadays?

-a python port of the xmltv libs have to be installed

i am sure a lib would have to be created for the c code to (i for sure wouldn't write my own code to create xmltv xml). that it is a python lib and not a c lib i think make little difference. this is easily solved solved with no clutter for the user, and very little for the coder.

-communication between c++ code and python is a bit "dodgy" in the current code

again, how would communication between a c grabber be much different? you would need much of the same code, but you wouldn't actually see the results (written to a file inorder to communicate between the two). i know this is an issue, but i am not so sure you wouldn't meet the same obstacles when using c code...although it could be a bit easier.

-limitations of python in general

what limitations exactly? python is a very powerful coding language and such remarks just mean you've spent too much time talking to me (who is a lousy python coder).

if you compare the xbmc devs with c knowlegde up to the scripters you see that there are many more active scripters (ok, walking on thin ice here but this is my impression...could of course have something to do with where i'm involved in things). tv grabbers are fairly easy tasks, which xbmc devs shouldn't be bothered with, and that's exactly why python is a good tool to use because python is so easy to learn. also there are lots of tv-scripts out there in python already which may be able to be ported to a grabber. and we already got a grabber for zap2it and dagbladet (almost done). one last thing is that, while ideally we should use sites that never ever change etc, this is in many places a dream as such sites doesn't exist for all parts of the globe.

in conclusion, i really can't see why you bring this up as i really don't think it will gain anyone if we go with c. i know that the communication is a problem, but i don't think it's better to go with c just because of that. not to mention that the python grabbers might be more easily replaced if broken...given that the c grabbers are compiled into binaries and irreplaceable after compile.

i know that you're aware of much of this and want devs to look at it (which is good), i just had to get it out...

affiini:

we already have a fully working zap2it grabber. i am sure it could be optimized but i don't find slow at all (except for the large download).

i am sure some of the statements in this post is wrong, if so please slam it back at me Smile

i won't be able to reply to any responses for some days, but i'll check this thread when i get back.

-enderw
anyone wishing to code a xmltv listing.xml python grabber for the united kingdom (uk) might find this (link) and this (link) interesting and usefull Wink
imho.. tvgrabber should be pythonbased ased.. webpages have a tendancy to change, and to accomodate that the grabbers should be easy to fix, not requiring the xdk to compile.

while a dll approach also would work, python would be byfar the simplest way of doing this, since python is written with the idea of text parseing in mind, c is definatly not. (i'm not a python programmer even).

python has a few quirks like not unloading, and as said having abit complicated c interface. but think they should be possible to overcome. not being in the normal build.bat can easily be changed if something as substantial like this relies on it.

but as said this is just my opinion, and am not the one coding it.

elupus
i completely agree with elupus. i coded up the changes when imdb changed (dumping them into a windows dll so that i didn't have to test using the xbox all the time) and it is an extreme pain to parse websites using c/c++. in a dll you also lose the use of stl string classes (ie you have to write a string class as well)

from what i've seen of the python parsers, they seem much easier to change and tweak.

just another opinion by someone not coding it Wink

cheers,
jonathan
any progress report... or beta release date?
i haven't seen jslawler around irc for quite awhile, this doesn't mean he isn't working on it, but i went ahead and turned over his code to the team, it is posted on sf.net as an update to the abandoned sub-project xmltv-gui. the svn is still setup and ready to go for any other dev's interested in this.

jslawler, if you would like to get the irc channel going again, please get in contact with me.

regards,
los93sol
i am still chugging away at this, but a lot slower at the moment.

i have managed to increase the sql efficiency for importing tv guide data. i have it able to import 3700 shows (2 days of american tv which is like 70 channels) in 1 and a half minutes. i got it to load an australian tv guide in about 7 seconds. as you can see we have a lot less channels :p i'm also experimenting with caching the tv guide data into memory to reduce the amount of sql queries.

it would be nice if someone made some nice tv guide buttons. and background, as a lot of the under the scenes code is done (for viewing the guide, not grabber stuff). i'd like to see it in action with a usable gui Smile

here is a small image of what i would love it to be like..but probably not with the blue theme as that wouldn't fit.

Image

images needed are:
+ button for unfocused grid item
+ button for focused grid item
+ image to go behind channel name label
+ image to go behind time label
+ background image

later on i would also need an image for the grid button focused and uncfocused if the tv show goes beyond the start of the grid, or beyond the end of the grid.



nice!

i wonder what other tv guide scripts and pvrs are using for images. we may be able to "borrow" some ideas.

or what about making a grid that just uses "colored" boxed (think html style). this way a user would be able to adjust the colors on the fly. you could color code different types of programs with different colors... like zap2it and titantv does with their grids.



Image
Pages: 1 2 3 4 5 6 7 8