Library plugin support - Ability for plugins to add plugins index to library database
#1
Lightbulb 
Library Plugin Support

I have been spending the past few days thinking of the best way to integrate RTMP streaming sites such as Hulu.com into the library, right along side of the content I have on my home network. I have tossed a couple ideas around but have realized that this would best be supported via Python.

Library Plugin support would allow for scripts to be written that can populate movies and tv shows into the Library (video database) from alternate locations such as RTMP streaming sites like Hulu.com. Having this extended ability available via a Python would make it completely optional and prevent the dev's from having to partake in coding library updates for features that may only target a limited audience. Leaving this more custom feature development where it belongs, in the Python/Plugin/Scripter community.

The idea is that a Python coder could develop a script which would scan a site such as Hulu.com for available episodes and add them to the library if an entry for that episode was not already found.

The path to the episode would be stored as a plugin:// path with the name of the video plugin coming after plugin:// (ex: pligin://HuluEpisodePlayer/), and the filename column in the files table would hold the episode identifying information needed to pass as parameters to the plugin to tell it which episode to play when called.

The database would be populated like so:

Code:
Path Table:
  idPath     strPath
  x          "plugin://PluginName/"
  
Files Table:
  idFile     idPath     strFilename
  y          x          "30.Rock.S01E09"

Storing the show information in a standard format used for filenaming (ex: "30.Rock.S01E09") would allow for existing scrapers to be used without any alterations to the underlying code.



Calling Plugins from Library Entries

This will add support for calling a plugin when a video is launched from library mode where the plugin to call and parameters to pass are stored in place of normal filepath information. The database would be populated like so:

Code:
Path Table:
  idPath     strPath
  x          "plugin://PluginName/"
  
Files Table:
  idFile     idPath     strFilename
  y          x          "30.Rock.S01E09"

Storing the show information in a standard format used for filenaming (ex: "30.Rock.S01E09") would allow for existing scrapers to be used without any alterations to the underlying code.

When a user is viewing content in Library mode and they select a plugin entry like the example above, the code behind it will parse the plugin name from the strPath value, then pass the episode information to the deciphered plugin in order for that plugin to build the RTMP url and load the streaming video.



I have boiled this down to two TRAC tickets:

http://trac.xbmc.org/ticket/5517 - Library Plugin Support
http://trac.xbmc.org/ticket/5518 - Calling Plugins from Library Entries


Looking for feedback:
  • Let me know what your take is on this idea.
  • What are the pros and cons that I may not be considering?
  • Is there a better way to integrate RTMP streaming content into the library?
Integrating with XBMC through the JSON-RPC interface?

Try the JSON-RPC Browser

Image
Reply
#2
Also, after re-reading this, it isn't really clear that in the Library Plugin request, I am requesting the ability to call a script automatically from the library update process. Not just requesting that a script be written.
Integrating with XBMC through the JSON-RPC interface?

Try the JSON-RPC Browser

Image
Reply
#3
angrycamel Wrote:
  • Let me know what your take is on this idea.
  • What are the pros and cons that I may not be considering?
  • Is there a better way to integrate RTMP streaming content into the library?

a) i wonder why someone would want to populate his home library with stuff that only exists remote for a certain amount of time and changes periodically - and is likely to be used to watch one time. and is no local file.

b) this would drastically increase the time needed for the "clean database" task.

i'd stick with the idea to have a library only for files that i own and can access anytime. if i need info on a streaming episode, i fire up my browser and have a look at the streaming site.

for me the more interesting upgrade would be to be able to add content i have on dvdrom and

a) have an option to display on which disc the stuff is outside its name (TAGS would be great for this)
b) prevent such content from being purged when cleaning the database.
cheers,azido :;):
Reply
#4
azido Wrote:a) i wonder why someone would want to populate his home library with stuff that only exists remote for a certain amount of time and changes periodically - and is likely to be used to watch one time. and is no local file.

b) this would drastically increase the time needed for the "clean database" task.

Thanks for the input. Allow me to explain...

I want to add these items to my library so that I can go to one place to view my tv shows whether its an episode that I have a file for on my server or one that is available on an RTMP site like Hulu. Firing up my browser requires that I leave the comfort of my living room and really defeats the purpose of having a media center.

As for the time that it will add to cleaning the database, remember, this is is being purposed as an optional Python setup, so if you don't want it, you don't have to use it. I preferred this way over C++ changes because of folks like yourself that would not care for the feature. Besides, I think "drastically" is a bit of an over statement.

azido Wrote:i'd stick with the idea to have a library only for files that i own
So I guess, you wouldn't be one to make use of this feature. Point taken, however just because you feel that way, doesn't mean that everyone feels that way. So again, this is optional for those who DO see a benefit of having all tv show content, local or streaming, available from a single interface.


azido Wrote:for me the more interesting upgrade would be to be able to add content i have on dvdrom and

a) have an option to display on which disc the stuff is outside its name (TAGS would be great for this)
b) prevent such content from being purged when cleaning the database.

Sounds like it would be a good idea. I encourage you to start a thread about it. Rolleyes
Integrating with XBMC through the JSON-RPC interface?

Try the JSON-RPC Browser

Image
Reply
#5
I've already said this to you (I think?) in PM angrycamel, but I'll post i there for completeness sake.

I want a similar feature, I disagree with how you want it implemented.

The way I think it should work is this:

1) Adding all episodes to library, whether the file exists or not. The idea here is that all episodes & seasons of a show are listed, and not just the episodes you have. There are many reasons for this, including making sure you aren't missing any episodes/specials, knowing when upcoming shows are airing, etc. Shows not stored locally would be dimmed, or marked in some way (by the skin). Obviously this would be a setting you could turn on/off. See this thread for more info: http://forum.xbmc.org/showthread.php?tid=34443

2) Allowing scripts to Add Items to Context Menu. This would allow a script to add an item to the context menu so you could launch the script or plugin from the library/now playing/files screen (to be defined in script). Relevant to this discussion, the context menu item would be something like "Search for Episode on Hulu | Search for Episode on Free Media TV". ( Not relevant to this discussion would be things like "Make Genius Playlist" while on a song. ) I put a ticket in trac asking for this.

The pros to this approach is that you don't have any information on a plugin IN the library. We all know that plugins that grab videos from less-than-legal sources tend to die out fairly quickly. I personally wouldn't want my library thinking a video existed when the whole site has died, or its structure has changed and the plugin hasn't been updated.

Also with angreycamel's approach, it sounds like a coding NIGHTMARE to handle this when when you're updating/cleaning your library, not to mention how much it would slow it down.
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#6
rwparris2 Wrote:1) Adding all episodes to library, whether the file exists or not. The idea here is that all episodes & seasons of a show are listed, and not just the episodes you have. There are many reasons for this, including making sure you aren't missing any episodes/specials, knowing when upcoming shows are airing, etc. Shows not stored locally would be dimmed, or marked in some way (by the skin). Obviously this would be a setting you could turn on/off. See this thread for more info: http://forum.xbmc.org/showthread.php?tid=34443

Actually I would go for something like this as well. It's a good idea.

rwparris2 Wrote:2) Allowing scripts to Add Items to Context Menu. This would allow a script to add an item to the context menu so you could launch the script or plugin from the library/now playing/files screen (to be defined in script). Relevant to this discussion, the context menu item would be something like "Search for Episode on Hulu | Search for Episode on Free Media TV". ( Not relevant to this discussion would be things like "Make Genius Playlist" while on a song. ) I put a ticket in trac asking for this.

The pros to this approach is that you don't have any information on a plugin IN the library. We all know that plugins that grab videos from less-than-legal sources tend to die out fairly quickly. I personally wouldn't want my library thinking a video existed when the whole site has died, or its structure has changed and the plugin hasn't been updated.

That's a good point. I can see where that could get messy if the plugin was outdated or the site gone completely.

What you purpose would work to satisfy my intentions just the same, it's just a different approach. I would be able to view, in a single location, shows that are either available via my personal video library or available on the internet via a stream. So, if either your idea or my own was implemented I would be a happy camper.

rwparris2 Wrote:Also with angreycamel's approach, it sounds like a coding NIGHTMARE to handle this when when you're updating/cleaning your library, not to mention how much it would slow it down.

I had thought that the normal library update/clean process would ignore plugin entries in the library so that the library plugin can handle it.
Integrating with XBMC through the JSON-RPC interface?

Try the JSON-RPC Browser

Image
Reply
#7
angrycamel Wrote:Thanks for the input. Allow me to explain...

I want to add these items to my library so that I can go to one place to view my tv shows whether its an episode that I have a file for on my server or one that is available on an RTMP site like Hulu. Firing up my browser requires that I leave the comfort of my living room and really defeats the purpose of having a media center.

i understand your point. however i still have some trouble in understanding why "temporary media" should be part of the library. if hulu removes an episode, it still would show up in your library, but can't be played since it's not available. does that make sense to you?

i guess a way better idea would be to improve the script which gets that streaming content, so it also downloads/displays more information for an episode/movie you like to watch by scraping this info from their website.

Quote:As for the time that it will add to cleaning the database, remember, this is is being purposed as an optional Python setup, so if you don't want it, you don't have to use it. I preferred this way over C++ changes because of folks like yourself that would not care for the feature. Besides, I think "drastically" is a bit of an over statement.
no offense, mate, just my thoughts Wink and basically a local database check for me should do only local lookups when cleaning it. your addition would mean to check the remote site(s) on cleanup for availability of the streams, which depends on their site(s) and your connection - and of course how many entries you have. those are dependencies that "could" increase the needed time dramatically..

Quote:So I guess, you wouldn't be one to make use of this feature. Point taken, however just because you feel that way, doesn't mean that everyone feels that way.
that's for sure, right. that's why i speak for my opinion, not talking about everyone elses thoughts Rolleyes

Quote: So again, this is optional for those who DO see a benefit of having all tv show content, local or streaming, available from a single interface.
again, i got your idea. but it might not hurt you to have 2 clicks to switch to a plugin/script output window, which is set up just like the library - would it? Smile

basically, though, i have a similar request on shoutcast streams for music. i would like to see some of my favourite online radio stations listed at least in file view for music. right now i have to stick on either favourites (which is only accessible from system menu) or a playlist (which is the option i use right now. so i guess i understand your wishes Smile

Quote:Sounds like it would be a good idea. I encourage you to start a thread about it. Rolleyes
already added those as feature requests on trac.. Smile
cheers,azido :;):
Reply
#8
Wow, I really replied with quite a bit of attitude last time, lol. Sorry bout that Shocked

azido Wrote:i understand your point. however i still have some trouble in understanding why "temporary media" should be part of the library. if hulu removes an episode, it still would show up in your library, but can't be played since it's not available. does that make sense to you?

Ya, that seems to be the consensus. I am definitely hearing that most people feel pretty strongly that the library should only be for local media. (I remember reading in another thread that Spiff felt the same way)

So maybe the library isn't the place for this... but where then? I am trying to make this thing wife proof. Meaning, when my wife sits down to use XBMC as the media center and she sees in big letters a section called TV Shows, she thinks, "oh ok, that's where I go to watch TV Shows". She or I for that matter, don't really want to have to jump from one area to another to find where that episode is available from.

Can you (or anyone) think of an alternative way to accomplish this without mucking with the library?
Integrating with XBMC through the JSON-RPC interface?

Try the JSON-RPC Browser

Image
Reply
#9
angrycamel Wrote:Wow, I really replied with quite a bit of attitude last time, lol. Sorry bout that

no problem, i can handle this. Nod


Quote:Ya, that seems to be the consensus. I am definitely hearing that most people feel pretty strongly that the library should only be for local media. (I remember reading in another thread that Spiff felt the same way)

to me it's kinda logical that i should be able to play all content i have in my library at any given time - because it's my library and not the worldwide movie/tv show database.. and i guess i'm not the only one thinking like this.. Wink

Quote:So maybe the library isn't the place for this... but where then? I am trying to make this thing wife proof.

hehe.. the wife acceptance factor. i know exactly what you mean Big Grin

well, there is this screen where it says

MOVIES
TV SHOWS
RECENTLY ADDED MOVIES
RECENTLY ADDED EPISODES
PLAYLISTS
VIDEO PLUGINS

- it could be inserted after TV SHOWS with an entry like TV SHOWS (EXTERNAL) or something more descriptive.
cheers,azido :;):
Reply
#10
what we need to handle this is a customizable library layout. once we have that you can WAF your personal library all you want. those want can do as azido suggest or you can make shows be a multipath consisting of your locals+any online source you see fit. afaict you do not need more information about them streams, you just need them displayed in a more accessible way.
Reply
#11
spiff Wrote:what we need to handle this is a customizable library layout. once we have that you can WAF your personal library all you want. those want can do as azido suggest or you can make shows be a multipath consisting of your locals+any online source you see fit. afaict you do not need more information about them streams, you just need them displayed in a more accessible way.

You've hit he nail on the head. My feature request was simply my attempt as solving the problem of making online content more accessible, but is in no way the only method.

Spiff, do you have any specific ideas on how to accomplish a customizable library layout? Is there something on the books to achieve this already?
Integrating with XBMC through the JSON-RPC interface?

Try the JSON-RPC Browser

Image
Reply
#12
me being sober for long enough or jmarshall catching an interest.it's not hard to do, just involved..
Reply
#13
Question 
Is it possible to do this?

I wish to scan, for instance, iPlayer's contents into my library. Currently I cannot even set the content for iplayer to TV (it lets me but doesn't save the change).

I have tried the same with the Simpsons plugin, which I can set the content to TV Shows, but it hangs when attempting to scan to the library.

Thanks in advance.
Reply
#14
plugins were not meant to be scanned into the library.
Reply
#15
MPauley73 Wrote:plugins were not meant to be scanned into the library.

I can successfully scan individual files to the library if I right click them once I'm deep enough in iPlayer so it's at least possible in principle is it not?
Reply

Logout Mark Read Team Forum Stats Members Help
Library plugin support - Ability for plugins to add plugins index to library database1