How does XBMC download uncompressed addon directory trees from http?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
unobtanium Offline
Junior Member
Posts: 10
Joined: Apr 2012
Reputation: 0
Post: #1
Hi there, i was inspired by anarchintosh's aggregate repo project (that he/she clearly never actually started) and have begun writing a repository aggregator for XBMC, in python. This means duplicating in python the code used in XBMC to download an addon from a repository.

I've written a whole lot of the python classes necessary for this already, but i need to ask the XBMC team: How does the repository framework (introduced in Dharma) check out an uncompressed addon directory from a repository? How can any http server be used to host an uncompressed repository, when there is no way of remotely walking the directory trees?

Walking seems necessary for any repository that does not use the standardised file format of compressed addons (ie. for compressed addons the names of all files in the addon directory - changelog, zip, icon, fanart, addon.xml - on the http server can be predicted and constructed).

It seems like pure magic that XBMC can download an uncompressed addon... how does it find the names of the various python filenames and subdirectories etc?

Is there possibly something funny going on with a curl wget like function?
(This post was last modified: 2012-04-10 18:40 by unobtanium.)
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #2
that is pretty much what's going on, directory listing ability is required on the server side.
find quote
BrokenCodes Offline
Member
Posts: 95
Joined: May 2009
Reputation: 2
Post: #3
(2012-04-10 18:55)spiff Wrote:  that is pretty much what's going on, directory listing ability is required on the server side.

It should be noted that this is not the best approach, better would be a listing, or XML file giving the locations of all the files that are to be downloaded, so that deprecation can occur without deleting the files deprecated, also allows reversion.

Code:
<xbmc addon>
<addon icon>lolfile.jpg</addon icon>
<addon name>"Blah Blah"</addon name>
   <addon version>"1.04"</addon version>
     <addon files>"subfolder/subfolder/subfolder/addonfile1.py";"subfolder/subfolder/subfolder/addonfile2.py"</addon files>
  <addon version>"1.03"</addon version>
...
</xbmc addon>
find quote
unobtanium Offline
Junior Member
Posts: 10
Joined: Apr 2012
Reputation: 0
Post: #4
and that xml would be fairly easy for repository admins to build (using a python script that walks the local directory.)

repository owners already have to use addons_xml_generator.py before committing... would just be a matter of adding a bit more code to it.
find quote
unobtanium Offline
Junior Member
Posts: 10
Joined: Apr 2012
Reputation: 0
Post: #5
FYI this is a link to my update to addons_xml_generator.py
http://forum.xbmc.org/showthread.php?tid=129401
find quote