![]() |
|
|||||||
| Plugin/Script (Python) Help and Support Python requests/suggestions, support, bugs, and everything python goes in here! Please, add platform prefix to threads that are not platform-independent!: Thread prefixes; "[LINUX]", "[LIVE]", "[MAC]", "[WINDOWS]", and "[XBOX]" |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 | |
|
Junior Member
Join Date: Nov 2004
Posts: 4
![]() |
hi,
i am a total newbie to python but i have an idea. i use this to organize my dvd movies: phpvideodb i created a xml file which contains information about the movies, taken from the database and converted to xml using perl. it looks like this: Quote:
i looked at some rss news scripts to understand hot it works, but often they are to specific to use them for my needs. the xml file can be accessed through a local apache server or simply copied to the xbox. if someone can give me some hints or has free time to set up an initial code, i would do my best to help and finish the script to perfection. thx rupert04 |
|
|
|
|
|
|
#2 |
|
Skilled Python Coder
Join Date: Jul 2004
Posts: 550
![]() |
python can easily parse your xml and do whatever you want with all the informations.
it will download the xml, then read it to extract all the tags. i am too much a beginner, and i don't know anything with xml... but many many existing scripts are doing like this |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2004
Posts: 4
![]() |
no one?
it couldn't be that uninterresting, only thing is that many people dont have a apache or something else running. but from my knowledge many other media(movie, music) databases tools have a export function, maybe there is a way to make this thing multi backend able. i wish i could start python, but atm i have to learn java for school. |
|
|
|
|
|
#4 |
|
Skilled Python Coder
Join Date: Jul 2004
Posts: 550
![]() |
sorry, but you answered like if you didn't see my answer....
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Nov 2004
Posts: 4
![]() |
oh, i read it.
can you point me to some scripts that can be converted, the ones i tried where to special. |
|
|
|
|
|
#6 |
|
Skilled Python Coder
Join Date: Jul 2004
Posts: 550
![]() |
the script that use the most xml i think is named kml browser.
i don't know yet how to use dom.minidom xml parser. but i need to learn. |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Oct 2004
Location: Barcelona
Posts: 28
![]() |
hi there,
i have done this two weeks ago with my movies db. now i can see my movie db using the xbmc. and with the posters *of the movies! ![]() i have my movies db in a apache web server and i use this php program to manage the db: modified version of php4flicks version 0.33.4 this php script can retrieve all the information from imdb inclued the poster of the moive similar to phpvideodb. this is my web movies db: http://www.afeno.no-ip.com/pelisdb/index4.php and this is the xml that it's automatically created using a php that i mafe to have the hole list of the movies: http://www.afeno.no-ip.com/pelisdb/print/listxml.xml then, my phyton scrip access to this xml and generate the list. it also download the poster and save them in the hd the first time that you check one movie. this script was designed to work with this xml design, but you can adapt it to your xml format. here you are phytom script that i created: http://www.afeno.no-ip.com/mymovies.py screenshot: http://www.afeno.no-ip.com/screenshot.jpg i have to say that i'm a beginner. i just used some others scripts to understand how does it works... now, i'm trying to check the imdb information directly throw the phytom script. does anyone know if i can call to some function/procedure from phytom to access to the imdb information for a movie? saludos. alfredo. |
|
|
|
|
|
#8 | |
|
Junior Member
Join Date: Nov 2004
Posts: 4
![]() |
sounds very good,
i will check your scripts out when they arrive. -- it dont really understand how the xml file gets parsed, i think its this lines: Quote:
peli is the title, right? is that spain? |
|
|
|
|
|
|
#9 | |||||
|
Junior Member
Join Date: Oct 2004
Location: Barcelona
Posts: 28
![]() |
hi,
in my case, the xml file has this format: Quote:
item.childnodes[1].childnodes[0].nodevalue -> is d028 (dvd number) item.childnodes[3].childnodes[0].nodevalue -> before sunset (movie name) item.childnodes[5].childnodes[0].nodevalue -> en (language) item.childnodes[7].childnodes[0].nodevalue -> 80 (time) item.childnodes[9].childnodes[0].nodevalue -> divx/xvid (type of avi) item.childnodes[11].childnodes[0].nodevalue -> 381681 (imdb movie id) and then i creat the row to add in the list: game = medias+"-> *"+peli+" * ("+dura+" min)" d028-> *before sunset (80 min) and i do this for each item (movie) Quote:
Quote:
2) then you have to modify the code to get the posters properly. 1) you have to change this part of the code in order to get all the movies properly: source: for node in dados.documentelement.childnodes: if (node.nodename == "item"): items.append(node) changed: for node in dados.documentelement.childnodes: if (node.nodename == "row"): items.append(node) source: for item in items: peli = str(item.childnodes[3].childnodes[0].nodevalue) dura = str(item.childnodes[7].childnodes[0].nodevalue) medias = str(item.childnodes[1].childnodes[0].nodevalue) id = str(item.childnodes[11].childnodes[0].nodevalue) self.posters.append(id) game = medias+"-> *"+peli+" * ("+dura+" min)" changed *for your xml: for item in items: title= str(item.childnodes[1].childnodes[0].nodevalue) lang = str(item.childnodes[3].childnodes[0].nodevalue) year= str(item.childnodes[5].childnodes[0].nodevalue) image = str(item.childnodes[7].childnodes[0].nodevalue) self.posters.append(image) game = year+" *"+title+" * ("+lang+")" 2) now, you have to change the 'poster()' function: (all the posters are stored in the 'posters' array) source: def poster(self,post): bg2 = downloadimage2('http://'+dirip+'/pelisdb/imgget.php?for='+self.posters[post],self.posters[post]+".jpg") self.addcontrol(xbmcgui.controlimage(580,50,97,150 , bg2)) changed for your xml: def poster(self,post): bg2 = downloadimage2(self.posters[post],imgname(self.posters[post])) self.addcontrol(xbmcgui.controlimage(580,50,97,150 , bg2)) and in your case you have to create a new function 'imgname': imgname (url):string that takes as argument the url and return the a name of the image. you only have to ensure that it generate a different name of different urls but it have to generate the same name for the same url... or something like this: imgname(http://ia.imdb.com/media/imdb/01/i/44/72/80m.jpg)= 01i447280m.jpg please, take in mind that the 'changed for your xml' code is just a suggestion but i didn't try it and may be it doesn't work or may be it has syntax errors. it's just the idea. Quote:
Quote:
good luck! if you have any doubt just let me know. i hope that i can help you, but i'm not use to program in phytom.... best regards. alfredo fenoglio |
|||||
|
|
|
|
|
#10 |
|
Guest
Posts: n/a
|
hi guys...
interesting topic i think ! but the most interesting thing isn´t said there. did anyone manage to solve the issue to convert his data to the xbmc - for example as mentioned as a python solution.i´m very interested in this topic and if anyone has brought this topice any further plz post it in here. i think a proper solution is a great for all of us thinking of doing something like that. i´m interested in everything beginning from what software are you using for webserver/php/perl/python to the scripts themselves. plz email me instantly :thumbsup: thank you very much for your work ! |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|