XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Plugin/Script (Python) Development

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!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-04-22, 09:45   #1
b01
Senior Member
 
Join Date: Nov 2003
Location: Southfield, MI
Posts: 114
b01 is on a distinguished road
Send a message via AIM to b01
Default

i want to know how do i go about getting info stored in an xbe when a dvd is inserted?

how do i extract the title and logo image of a game?
__________________
reading must be magical or something, it's how i find all da anwsers!
------
Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300
b01 is offline   Reply With Quote
Old 2004-04-22, 20:50   #2
b01
Senior Member
 
Join Date: Nov 2003
Location: Southfield, MI
Posts: 114
b01 is on a distinguished road
Send a message via AIM to b01
Default

so i found the xbe file format on caustik's website:

xbe file format, by caustik

very nice caustik

so i could potenitally write a decoder, but caustik already wrote one, all i have to do is translate his code into python and give him credit.

yes i'm aware that darkie could provide me acess to xbmc's method, but then they would probably have to write an interface for it and include it in the xbmc python library for everyone to use, and i would have to wait until the next release.

the only question i have now is; what method do i use to open the xbe file, so that i can access this data?
__________________
reading must be magical or something, it's how i find all da anwsers!
------
Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300
b01 is offline   Reply With Quote
Old 2004-04-23, 04:04   #3
b01
Senior Member
 
Join Date: Nov 2003
Location: Southfield, MI
Posts: 114
b01 is on a distinguished road
Send a message via AIM to b01
Default

i finally got it, i can now retreive the title of an xbe, here is the script i used:


Quote:
import xbmc, xbmcgui, os

disc_present = 96 # xbmc.tray_closed_media_present


dvd_dir = "d:\\" # the dvd drive base directory.

class xbeparser:

textfile = open("e:\gametitle.txt", "a+") # create a text file to output data to (a.k.a - log file).


if xbmc.getdvdstate() == disc_present: #if a disc is in the dvd dive then execute code below.

openedxbe = open("d:\\default.xbe", "rb")
openedxbe.seek(384, 0)
textfile.write(openedxbe.read(80) + "\n")

openedxbe.close() # never forget to close a file you opened.
textfile.close() # never forget to close a file you opened.

x = xbeparser() # call the class so that the code can be run.
del x
__________________
reading must be magical or something, it's how i find all da anwsers!
------
Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300
b01 is offline   Reply With Quote
Old 2006-06-15, 15:56   #4
blittan
Team-XBMC Handyman
 
blittan's Avatar
 
Join Date: Jun 2004
Location: Sweden
Posts: 1,302
blittan is on a distinguished road
Send a message via MSN to blittan
Default

this method results in a binary string.

after alot of testing and thinking, i have finally solved it :d

my dirty hack:

openedxbe = open("test.xbe", "rb") # open test.xbe for reading in binary mode
openedxbe.seek(400, 0) # set startingpoint for reading
xbetext = openedxbe.read(80) # read out the entire section assigned to the title
openedxbe.close() # never forget to close a file you opened.
bintext = xbetext[::2] # copy every odd character to a new string
xbetext = "" # empty the xbetext string
for s in bintext: # iterate the string
if ord(s) in range(32, 127): #if the current character is in the ascii range
xbename += s # add the character to xbename

thats all there is to it...



__________________
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.


blittan is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SYStem Hardware info mem unit info must adjust loction gamepc XBMC for Xbox Specific Support 1 2006-08-23 23:16
SMB accessing my workgroup lewish XBMC for Xbox Specific Support 0 2006-04-16 18:25
Accessing the dvd rom exego XBMC for Xbox Specific Support 0 2005-01-22 20:50
Accessing settings... sd00 XBMC for Xbox Specific Support 4 2004-12-10 19:36
Need help accessing all my drives via FTP magicstyx07 XBMC for Xbox Specific Support 8 2004-11-06 05:22


All times are GMT +2. The time now is 15:26.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project