2011-04-19, 23:26
I'am currently developing a XBMC-Gallery3 Plugin. Working well so far, but i'am suffering the following problem.
While connecting to a "secured" gallery, there are no "public" links. Images and Thumbnails has to be "accessed" trough a REST-Call.
So my "strategy" is, to download all Thumbs and Images and store them into the addon-user-dir. Image how long this takes for a (sub)gallery with a large count of images, especialy if a "recursive" slideshow has started and recursively "all" images are cached.
my questions are:
are there any was to hand over the additional request-header ('X-Gallery-Request-Key') to the XBMC environment, so that a call to a given item.url will be extend with it? So only the whole prefetching part could be hand over to the existing "caching"-part of xbmc.
While connecting to a "secured" gallery, there are no "public" links. Images and Thumbnails has to be "accessed" trough a REST-Call.
Code:
request = urllib2.Request("http://mygallery/index.php/rest/item/1234567?size=full)
request.add_header('X-Gallery-Request-Key', "MySecured API-Key")
sock = urllib2.urlopen(request);
imageFile = open(targetLink,'w');
imageFile.write(sock.read());
imageFile.close();
sock.close();
So my "strategy" is, to download all Thumbs and Images and store them into the addon-user-dir. Image how long this takes for a (sub)gallery with a large count of images, especialy if a "recursive" slideshow has started and recursively "all" images are cached.
my questions are:
are there any was to hand over the additional request-header ('X-Gallery-Request-Key') to the XBMC environment, so that a call to a given item.url will be extend with it? So only the whole prefetching part could be hand over to the existing "caching"-part of xbmc.