Image Addon, Rest-Calls and Caching
#1
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.

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.
Reply
#2
Wish i could help but just wanted to say good luck. this would be great. I use gallery3 a lot.
Reply
#3
So rather than get the images manually, you want to hand this off to XBMC (so that it does the image caching). But you need to send the extra HTTP header?

You can do this with the following:
Code:
http://mygallery/index.php/rest/item/1234567?size=full | X-Gallery-Request-Key=API

Anything after the pipe ('|') is treated as an HTTP header. Add extra headers by placing an "&" between them. Just use this syntax in place of any URL within XBMC.
Reply
#4
hippojay Wrote:So rather than get the images manually, you want to hand this off to XBMC (so that it does the image caching). But you need to send the extra HTTP header?

You can do this with the following:
Code:
http://mygallery/index.php/rest/item/1234567?size=full | X-Gallery-Request-Key=API

Anything after the pipe ('|') is treated as an HTTP header. Add extra headers by placing an "&" between them. Just use this syntax in place of any URL within XBMC.


you made my day Smile thanks alot

by the way, where you get this info? i'am seeking for such informations way to long ...

greetings
Raptor 2101
Reply
#5
Raptor 2101 Wrote:you made my day Smile thanks alot

by the way, where you get this info? i'am seeking for such informations way to long ...

greetings
Raptor 2101

Such is developing for XBMC - the information is scattered around, sometimes in the wiki but mostly with in other peoples heads. I only know because I wanted to do it too..

Basically search here or try or work it out from the source code :-(
Reply
#6
It'd be nice if you could add that to the wiki pages on scripting/plugins - wherever you think is appropriate.
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.


Image
Reply
#7
ok i need to drill your knowledge again.

unfortunately the REST-API-Provicer of gallery3 react not pleased about "unexpected".
In short: i have to clear the other headers befor adding die API-Key so only this one header will be send.

Are there any ways?
Reply
#8
Hi, how did you get on with this? Is it suitable for a server hosting xbmc and gallery3?

Thanks,
Reply
#9
the "addon-status" is sleeping!

I am running a test version on my Homebox and it running fine for slideshows and so on. But i will do a rewrite of the source soon, cause i gather some experience with Gallery3-REST while developing an andoid-application.

if your interested i can pull the code into github and you can fork it.
Reply
#10
Raptor 2101 Wrote:the "addon-status" is sleeping!

I am running a test version on my Homebox and it running fine for slideshows and so on. But i will do a rewrite of the source soon, cause i gather some experience with Gallery3-REST while developing an andoid-application.

if your interested i can pull the code into github and you can fork it.

Interested Smile link?
Reply

Logout Mark Read Team Forum Stats Members Help
Image Addon, Rest-Calls and Caching0