View Full Version : Play A File from inside a RAR Archive.
hattmall
2008-12-14, 23:33
How can I use Python to do this?
I have an Archive File that has a DIVX in it.
If I view the file in Filemanger. I can click on the archive. It will open and show me the video file. Then If I click on the video file it will play.
If I am in the Videos Window, I can browse to the archvie. Press the white button and select play from the menu and it will begin playing.
How can I do this in Pythong. I have tried the just using XBMC.Player().play('Q:\\scripts\\'d.rar')
as well as the Execute built in
xbmc.executebuiltin("XBMC.PlayMedia(Q:/scripts/d.rar)")
How can I get this to work. Thanks
rar://<urlencodedpathtothearchive>/<pathinsidearchive>
hattmall
2008-12-15, 12:40
#xbmc.executebuiltin("XBMC.PlayMedia(rar://q:/scripts/d.rar/cd-xvid-dvf.avi)")
I still an unable to get it, can someone give an example?
Also I will not always know the path inside the archive is there a way around that?
hattmall
2008-12-15, 13:12
Ok, I got it.
xbmc.executebuiltin("XBMC.PlayMedia(rar://Q%3a%5cscripts%5cd%2erar/cd-xvid-dvf.avi)")
Didn't exactly know what url encoded meant. Pulled this from the log.
Now, The problem is I don't know the name of the file that is contained in the archive. Is there an easy way to play it just specifying the archive.
well, ask it to queue the directory that should work in theory
hattmall
2008-12-16, 14:39
I couldn't figure out how to queue the directory, but i was able to get it to work using some of the httpapi commands.
page = xbmc.executehttpapi("GetMediaLocation(video;Q:\scripts\d.rar;pathsonly)")
zfilename = re.compile('li>(.+?)\n').findall(page)
xbmc.Player().play(zfilename[0])
Let's get it.
hattmall
2008-12-16, 16:39
Is there anyway to apply a password to the url string?
no passworded archives are not supported
hattmall
2008-12-17, 21:24
The method i am using, if the file is contained in a sub directory, it will only display the subdirectory name (Using the GetMediaLocation from the httpapi) instead of the actual file name. How can I "go deeper" (penetrate further)... the archive file, or is there another / better way to do this.
Also when you say "queue the directory" do you mean the add to the video/audo playlist the folder that the archive file is in (for the archive file "q:\scripts\d.rar" i should add to the playlist "q:\scripts")?
And what is the most recommended way of queuing an entire directory. I am trying many different approaches. Thanks
no. what i mean is that an archive is a directory.
rar://<urlencodedpathtoarchive>/
that should enqueue any files in that directory assuming you use the same piece of code that would play all files in e.g. q:\videos\
to "dig futher" you'd have to do a getdirectory and add additional (probably recursive) logic. you should consider an archive just like any other directory