Open specific addon window.
#1
I'm new to this json mumbo jumbo, so please excuse my ignorance.

I was hoping someone can help with a solution for opening the Youtube addon, and have it specifically go directly in the My Subscription window.

I used to be able to do this with the old webserver builtinfunctions commands. Now, not so sure how to with json.

I'm able to use EventGhost, with the XBMC Repeat addon, and add a jsonrpc macro to activatewindow, with the following:

["plugin.video.youtube.beta"]

but that just opens the Youtube addon, and I can't figure out the proper syntax to have go directly into the addon window for My Subscriptions.

I added the My Subscriptions window to my favorites menu, and I posted the xml entry below:

Code:
<favourite name="My Subscriptions" thumb="C:\Users\intelpc\AppData\Roaming\XBMC\addons\plugin.video.youtube\thumbnails\subscriptions.png">ActivateWindow(10025,&quot;plugin://plugin.video.youtube.beta/?folder=true&amp;login=true&amp;path=%2froot%2fsubscriptions&amp;user_feed=subscriptions&quot;)</favourite>

If anyone has a solution, please post it up. Thanks much, in advance!
Reply
#2
Also looking for the solution to this...

I'm trying to run a json code in my irule remote for XBMC to open SportsDevil plugin and start off at the Live Sports Section...

so far, I can get the plugin to load with the following:

{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "addonid": "plugin.video.SportsDevil"}, "id": 1 }

which looks like this when encoded..

http://192.168.0.104:8080/jsonrpc?reques...1%20%7D%20


I'm not sure if there is a parameter, path or directory to go right into the Live Sports section... any help?
Reply
#3
Not sure it would work but have you looked at the GUI.ActivateWindow method?

See http://forum.xbmc.org/showthread.php?pid=1218875 for some examples
Reply
#4
I haven't yet, thanks, I'll look into it
Reply
#5
Keep in mind that Sports Devil isn't supported here, and therefore shouldn't be discussed here.

For your problem, you're missing the parameters to be passed to the addon to trigger a certain view. Enable debug logging in Xbmc and launch the target addon and navigate to the desired window. Then grab your Xbmc.log and start reading. You're looking for something like plugin://my.video.plugin?mode=25&key=value&this=that
Your json above is already passing in the addon I'd, you just need to get the part after the question mark. With that in hand, add another dict to your json called params at the Same level as addonid. It's value should be the key/value pairs found after the question mark
Reply
#6
Thanks for the reply.

I've been playing around with this for a while (currently with ustvnow app which I think is supported here) to start in the Live section. I got the debug log and found the mode when selecting the Live section; plugin://plugin.video.ustvnow/?mode=live

I've tried the following json codes without any luck...

{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "addonid": "plugin.video.ustvnow", "params": { "mode": "live" } }, "id": 2 }

{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "plugin.video.ustvnow", "params": { "mode": "live", "id": "1"} }, "id": 2 }

I've also tried a few others, what am I missing here?

The following is the debug section of when I select the Live in the plugin

Code:
18:40:23 T:2953924608   DEBUG: ustvnow: adding dir: Live - plugin://plugin.video.ustvnow/?mode=live
18:40:23 T:2953924608   DEBUG: ustvnow: adding dir: Recordings - plugin://plugin.video.ustvnow/?mode=recordings
18:40:23 T:2970505216   DEBUG: WaitOnScriptResult- plugin returned successfully
18:40:23 T:2953924608    INFO: Scriptresult: Success
18:40:23 T:2973769728  NOTICE: Thread Background Loader start, auto delete: false
18:40:23 T:2973769728   DEBUG: Thread Background Loader 2973769728 terminating
18:40:23 T:2973769728  NOTICE: Thread Background Loader start, auto delete: false
18:40:23 T:2960920576 WARNING: CreateLoader - Unsupported protocol(plugin) in plugin://plugin.video.ustvnow/logo.png
18:40:23 T:2960920576   DEBUG: GetImageHash - unable to stat url plugin://plugin.video.ustvnow/logo.png
18:40:23 T:2954457088 WARNING: CreateLoader - Unsupported protocol(plugin) in plugin://plugin.video.ustvnow/../../logo.png
18:40:23 T:2954457088   DEBUG: GetImageHash - unable to stat url plugin://plugin.video.ustvnow/../../logo.png
18:40:23 T:2973769728   DEBUG: Thread Background Loader 2973769728 terminating
18:40:23 T:2970505216 WARNING: CreateLoader - Unsupported protocol(plugin) in plugin://plugin.video.ustvnow/../../../logo.png
18:40:23 T:2970505216   DEBUG: GetImageHash - unable to stat url plugin://plugin.video.ustvnow/../../../logo.png
18:40:23 T:2971570176 WARNING: CreateLoader - Unsupported protocol(plugin) in plugin://plugin.video.ustvnow/../logo.png
18:40:23 T:2971570176   DEBUG: GetImageHash - unable to stat url plugin://plugin.video.ustvnow/../logo.png
18:40:23 T:2953924608    INFO: Python script stopped
18:40:23 T:2953924608   DEBUG: Thread XBPyThread 2953924608 terminating
18:40:23 T:2698199464   DEBUG: waiting for python thread 17 (/Users/Gill/Library/Application Support/XBMC/addons/ustvnow/default.py) to stop
18:40:23 T:2698199464   DEBUG: python thread 17 (/Users/Gill/Library/Application Support/XBMC/addons/ustvnow/default.py) destructed
18:40:25 T:2698199464   DEBUG: Keyboard: scancode: 24, sym: 000d, unicode: 000d, modifier: 0
18:40:25 T:2698199464   DEBUG: OnKey: return (f00d) pressed, action is Select
18:40:25 T:2698199464   DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.video.ustvnow/?mode=live)
18:40:25 T:2698199464   DEBUG:   ParentPath = [plugin://plugin.video.ustvnow/]
18:40:25 T:2960920576   DEBUG: StartScript - calling plugin ustvnow('plugin://plugin.video.ustvnow/','2','?mode=live')
18:40:25 T:2960920576    INFO: initializing python engine.
18:40:25 T:2960920576   DEBUG: new python thread created. id=18
18:40:25 T:2960920576   DEBUG: WaitOnScriptResult - waiting on the ustvnow (id=18) plugin...
18:40:25 T:2953924608  NOTICE: Thread XBPyThread start, auto delete: false
18:40:25 T:2953924608   DEBUG: Python thread: start processing
18:40:25 T:2953924608  NOTICE: -->Python Interpreter Initialized<--
18:40:25 T:2953924608   DEBUG: Process - The source file to load is /Users/Gill/Library/Application Support/XBMC/addons/ustvnow/default.py
18:40:25 T:2953924608   DEBUG: Process - Setting the Python path to /Users/Gill/Library/Application Support/XBMC/addons/ustvnow:/Users/Gill/Library/Application Support/XBMC/addons/script.module.TheYid.common/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.demjson/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.beautifulsoup4/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.myconnpy/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.beautifulsoup/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.common.plugin.cache/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.buggalo/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.mechanize/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.xbmcswift2/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.t0mm0.common/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.simplejson/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.turtlex/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.addon.common/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pil/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.simple.downloader/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.requests/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.urlresolver/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.parsedom/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.elementtree/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.feedparser/lib:/Users/Gill/Library/Application Support/XBMC/addons/script.module.metahandler/lib:/Applications/XBMC.app/Contents/Frameworks:/Applications/XBMC.app/Contents/Frameworks/lib/python26.zip:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-darwin:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac/lib-scriptpackages:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-tk:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-old:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/site-packages:
18:40:25 T:2953924608   DEBUG: Process - Entering source directory /Users/Gill/Library/Application Support/XBMC/addons/ustvnow
18:40:25 T:2953924608   DEBUG: Instantiating addon using automatically obtained id of "plugin.video.ustvnow" dependent on version 1.0 of the xbmc.python api
18:40:25 T:2953924608   DEBUG: ustvnow: plugin url: plugin://plugin.video.ustvnow/
18:40:25 T:2953924608   DEBUG: ustvnow: plugin queries: {'play': '', 'mode': 'live'}
18:40:25 T:2953924608   DEBUG: ustvnow: plugin handle: 2
18:40:25 T:2953924608   DEBUG: ustvnow: live
18:40:25 T:2953924608   DEBUG: ustvnow: logging in
Reply
#7
I believe this is the correct format:
Code:
{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"plugin.video.ustvnow", "params":{"mode":"live"}},"id":"1"}}
Reply
#8
The params need to be "?mode=live" or with out the question mark
Reply
#9
Hey all,

This topic seems like a good fit for what I'm trying to accomplish- is there a better way for interacting with addons using JSON-RPC? I'm talking about content addons such as Youtube, Netflix, Hulu.

I'm trying to implement a web interface that'll communicate with XBMC for searching, playing, etc. on Youtube for example.

Before you ask why would I want that, let me explain- It's a part of a web interface that solely relies on XBMC for communication, and will eventually act as the only XBMC interface. This means I won't have to use the normal GUI, and could only rely on the web interface using JSON-RPC.

Going for the obvious, which is communicating with the Youtube API directly and only playing using plugin:// won't be a good solution, since then I'll have to interact with every plugin API I want to display on the web interface, and that's just alot of work.

I've tried opening a plugin (ExecuteAddon), and interacting with it using Files.GetDirectory, and finally using Player.Open to play.

Is this the best way to handle this?

Thanks,
Or
Reply
#10
Files.GetDirectory should allow you to retrieve items from any plugin like you do when browsing it in the GUI.

Not sure if you need ExecuteAddon for plugins.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#11
Thanks so much for this @Montellese!

I'm using Files.GetDirectory as you suggested.
Now the problem is, that when I navigate to the search on Youtube, It's blocking and shows the search modal on XBMC, and I can't input through the Web-Interface, only from the GUI itself.

Is there a better way to do this?

Thanks a mil,
Or
Reply
#12
You can use JSON-RPC to provide an input for the on screen keyboard using Input.SendText. Apart from that there's not much you can do as every addon provides its own search functionality etc.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#13
I really do appreciate it. Thanks.

I can't really execute Input.SendText because XBMC is waiting for text, and is blocking (doesn't go to the next py command).

Allow me to paste what I mean:
getsearchbar = xbmc.Files.GetDirectory(directory=directory, media=media) ----> stays here and waits for me to input the text
getsearchbar = xbmc.Input.SendText(text=u'gopro')
return xbmc.Input.Select()

I hope I'm making sense here.

For the last time - I really do appreciate it.

Regards,
Or
Reply
#14
I followed ncarth's suggestion and I was able to open a specific addon window like this:

Code:
{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "GUI.ActivateWindow",
    "params": {
        "window": "videos",
        "parameters": [
            "plugin://plugin.video.your_plugin/?param1=foo&param2=bar"
        ]
    }
}

Cheers
Reply
#15
Thanks for this @victmo!
I've tried both:

Code:
{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "GUI.ActivateWindow",
    "params": {
        "window": "videos",
        "parameters": [
            "plugin://plugin.video.youtube/?path=/root/search/new&feed=search&login=false&"
        ]
    }
}

And:
Code:
{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory":"plugin://plugin.video.youtube/?path=/root/search/new&feed=search&login=false&", "media":"files"}, "id": 1}

They both unfortunately block the UI, waiting for the user to type in a search term, while I myself would like to populate it.

Any thoughts?

Thanks,
Or
Reply

Logout Mark Read Team Forum Stats Members Help
Open specific addon window.0