Using OAuth URLs for thumbnails

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
EDevil Offline
Junior Member
Posts: 8
Joined: May 2005
Reputation: 0
Post: #1
Hello.

I'm writing an addon that interfaces with an OAuth API. This API allows me to list and download videos, and also to obtain their thumbnails.

While populating ListItems I was thinking of supplying XBMC with pre-authed URLs as the 'thumbnail' attribute, but it seems XBMC does multiple requests to this resource (HEAD, followed by two GETs). Since OAuth authorizations carry a nonce, after the first request all the others will fail.

What would be the best approach to solve this issue? I was thinking of downloading all the thumbs of that page and supply local file:// URLs, but loading all the thumbs is a slow process to do before rendering the page. Also, where would I store all these thumbnails?

Thanks for the help.
find quote
sphere Offline
Team-Kodi Member
Posts: 1,223
Joined: Jul 2009
Reputation: 50
Location: Germany
Post: #2
Let me quote my reply from the other thread, here is a better place for that discussion:

(2013-07-31 21:12)sphere Wrote:  
(2013-07-31 18:43)EDevil Wrote:  Some async mechanism to supply the URL both in the "thumbnail" attribute of a ListItem and in the "path" attribute when listing a SlideShow would be perfect.

This is already possible.
In Detail:
- You can use setResolvedUrl() for the path which is async (your plugin will be called to retrieve the playpath when needed).
- You can write an image plugin and use its plugin url as slideshow path (combine with above).

But anyway, its sad that there is no real progress on 27/30 api wishes.

My GitHub. My Add-ons:
[Image: IOoywq0.jpg]
find quote
EDevil Offline
Junior Member
Posts: 8
Joined: May 2005
Reputation: 0
Post: #3
I already use a "plugin://" URL that uses setResolvedUrl() on the "path" attribute of ListItems in the video and audio components of my addon. Both contents play fine. It is only in the images component that setResolvedUrl with "plugin://" paths is not supported.

You suggested writing a custom Image plugin that would do the slideshow instead of using the builtin slideshow? How hard would this be? Is there some other plugin I can use as an example? This is my first plugin so please bear with me...

Would this enable me to use "plugin://" URLs in the "thumbnail" component of ListItems?

Thanks for the help!
(This post was last modified: 2013-08-01 12:07 by EDevil.)
find quote
sphere Offline
Team-Kodi Member
Posts: 1,223
Joined: Jul 2009
Reputation: 50
Location: Germany
Post: #4
(2013-08-01 10:04)EDevil Wrote:  I already use a "plugin://" URL that uses setResolvedUrl() on the "path" attribute of ListItems in the video and audio components of my addon. Both contents play fine. It is only in the images component that setResolvedUrl with "plugin://" paths is not supported.

You suggested writing a custom Image plugin that would do the slideshow instead of using the builtin slideshow? How hard would this be? Is there some other plugin I can use as an example? This is my first plugin so please bare with me...

Would this enable me to use "plugin://" URLs in the "thumbnail" component of ListItems?

Thanks for the help!

The plugin VFS (URLs with "plugin://") only gets resolved on ListItems path (not in thumbnail or iconImage).

But you can start a (builtin) slideshow to a plugin VFS where you expose a bunch of listitems with each pointing to plugin VFS single listitem which uses setResolvedUrl to return its path async. So this way only works for slideshows on an image plugin.

My GitHub. My Add-ons:
[Image: IOoywq0.jpg]
(This post was last modified: 2013-08-01 10:27 by sphere.)
find quote
EDevil Offline
Junior Member
Posts: 8
Joined: May 2005
Reputation: 0
Post: #5
I have tried to do what you suggest. What ended up happening was that when I click on a picture, which should start the SlideShow functionality, I get an empty list.

This is my code: https://github.com/edevil/CloudPTXBMC/bl...don.py#L90

So, browse_image() builds lists of ListItem with paths of type "plugin://". These paths point to show_image() which immediately returns a single ListItem with setResolvedUrl(). Is this not it?
find quote
sphere Offline
Team-Kodi Member
Posts: 1,223
Joined: Jul 2009
Reputation: 50
Location: Germany
Post: #6
I tried it myself and you are right - it doesn't work!
Either I am wrong or it worked some time ago.

Sorry.

My GitHub. My Add-ons:
[Image: IOoywq0.jpg]
find quote