Play favorites using json
#1
i am trying to play a live stream form favorites. i get the data from favorites i got this output.

Array
(
[id] => 1
[jsonrpc] => 2.0
[result] => Array
(
[favourites] => Array
(
[0] => Array
(
[path] => plugin://plugin.video.ZemTV-shani/?url=8xm&mode=9&name=%5BCOLOR+FFe37101%5D8xm%5B%2FCOLOR%5D
[thumbnail] => http://www.eboundservices.com/images/8xm.jpg
[title] => [COLOR FFe37101]8xm[/COLOR]
[type] => media
)

[1] => Array
(
[path] => plugin://plugin.video.ZemTV-shani/?url=aHR0cDovLzEzMC4xODUuMTQ0LjYzOjE5MzUvaXB0di9kYXdubmV3cy9wbGF5bGlzdC5tM3U4&mode=37&name=%5BCOLOR+FF11b500%5DDawn+news+v3%5B%2FCOLOR%5D
[thumbnail] => http://cdnimg.dynns.com/iptvpanelnew/pro...wnnews.jpg
[title] => [COLOR FF11b500]Dawn news v3[/COLOR]
[type] => media
)

[2] => Array
(
[path] => plugin://plugin.video.ZemTV-shani/?url=cHYyOkdlbyBFbnRlcnRhaW5tZW50&mode=11&name=%5BCOLOR+FF11b500%5DGeo+entertainment+v2%5B%2FCOLOR%5D
[thumbnail] =>
[title] => [COLOR FF11b500]Geo entertainment v2[/COLOR]
[type] => media
)

[3] => Array
(
[path] => plugin://plugin.video.ZemTV-shani/?url=aHR0cDovLzEzMC4xODUuMTQ0LjYzOjE5MzUvaXB0di9nZW9uZXdzL3BsYXlsaXN0Lm0zdTg%3D&mode=37&name=%5BCOLOR+FF11b500%5DGeo+news+v3%5B%2FCOLOR%5D
[thumbnail] => http://cdnimg.dynns.com/iptvpanelnew/pro...932geo.jpg
[title] => [COLOR FF11b500]Geo news v3[/COLOR]
[type] => media
)

)

[limits] => Array
(
[end] => 4
[start] => 0
[total] => 4
)

)

)


when i try to player.open or gui.svtivstewindow it is not working. a working example will help.
Reply
#2
exactly what parameters are you sending with the open method.
at the least you need to include one of the required urls decoded.
Reply
#3
I am trying to use the following json-rpc

http://localhost/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videos","parameters": ["plugin://plugin.video.ZemTV-shani/?url=8xm&mode=9&name=[COLOR FFe37101]8xm[/COLOR]"]}}
Reply
#4
Oh your trying to play links provided by some plugin, I wasn't paying attention and assumed from your library...
Actually I'd like to understand how to do this as well...
Reply
#5
Very interested in this too. Have tried to make working json commands from favorites (or super favorites) for a long time with very little success.
A way to look at either the favorites.xml or the response to:
http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Favourites.GetFavourites","params":{"properties":["window","path","thumbnail","windowparameter"]},"id":1}
and then create a command from this result.

Either with Player.Open along the lines of:
http://localhost:8080/jsonrpc?request=jsonrpc?request={"jsonrpc":"2.0","method": ”Player.Open”,”params":{"special://home/addons/plugin.video. ...etc.etc....
or possibly using GUI.ActivateWindow with something like:
http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videos","parameters": ["plugin://plugin.video. .......etc. etc

I have seen many version of this question over the years and rarely any useful working examples.
Any working examples would really be much appreciated by many i would think as there are always many views on threads about this
and is a bit beyond trivial Wink
best wishes for 2016 to all
Reply
#6
The solution is described all over this sub forum and the Wiki.....

You need to url encode the request when using JSON via HTTP GET.
Reply
#7
(2016-01-07, 15:27)Tolriq Wrote: The solution is described all over this sub forum and the Wiki.....

You need to url encode the request when using JSON via HTTP GET.

Thanx Tolriq,

I am using JSON extensively with Kodi in my app (iRule) so I know how to url-encode the commands.
No problem there as it works great.

The problem I have is specifically with favorites.
If there is a thread that explains how to build JSOn commands for favorites I would be ever so grateful for a link!
thanx
Reply
#8
Favorites does not exist as an playable entity.

You need to take the data and start the commands either to play or open the media.

You commands shown previously are the correct one, the only reason it would not work are either the plugin does not work or that you have not url encoded the request parameter as I said.

To take one previous example :
This is invalid
Code:
http://localhost/jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videos","parameters": ["plugin://plugin.video.ZemTV-shani/?url=8xm&mode=9&name=[COLOR FFe37101]8xm[/COLOR]"]}}

This is valid :
Code:
%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22GUI.ActivateWindow%22%2C%22id%22%3A1%2C%22params%22%3A%7B%22window%22%3A%22videos%22%2C%22parameters%22%3A%20%5B%22plugin%3A%2F%2Fplugin.video.ZemTV-shani%2F%3Furl%3D8xm%26mode%3D9%26name%3D%5BCOLOR%20FFe37101%5D8xm%5B%2FCOLOR%5D%22%5D%7D%7D
Reply
#9
(2016-01-08, 11:17)Tolriq Wrote: Favorites does not exist as an playable entity.

You need to take the data and start the commands either to play or open the media.

Thanx Tolriq,

As I tried to indicate with my examples, I am aware of that.
It's just a bit hard to get that working and figure out where in the JSON code or the addon the problem is. I will keep experimenting though.

If someone can provide working examples here of how to:

* play a specific stream with Player.Open
* show a favorite from within an addon with GUI.ActivateWindow

... that would be fab.

We could then troubleshoot and ask an addon dev to support this if it does not work.

thanx again!
Reply
#10
Both commands are shown all over this forum...

A player.open is a player.open there's nothing specific for favorites.

There's even a full thread of example : http://forum.kodi.tv/showthread.php?tid=157996 right in this forum.
Reply
#11
Thanx again tolriq.

Yes, I have read that thread many times and it has no examples of how to open favouritestreams via JSON.
I have in fact never seen a working example even though i regularly search for this.
If I do I will post it here. I am not a code guy and this JSON thing is not trivial and seems to fall into territory where it is devs
using it within their apps and for example HT enthusiasts like myself who try to roll their own remotes using off the shelf apps like iRule.
Not entirely trivial either Wink I will keep experimenting...
thanx again
Reply
#12
This is a joke ...

There's nothing specific for Favorites at all, how many times do I have to repeat that ?

The said thread is very clear and give the exact command you need.

Code:
//Play a single video from file
http://192.168.15.117/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"Media/Big_Buck_Bunny_1080p.mov"}}}

So please take time to read things written instead of assuming they do not contain the answers you need.
Reply
#13
No joke I'm afraid.

I am sorry if I am coming across as stupid here and confess openly that I am better at playing the piano than writing code Wink
Grateful for your attempts to assist, but If I irritate you, simply please don't answer.

I can honestly say that I have read lots of stuff about this but can not seem to string the pieces together. Terribly sorry
about my lack of competence but that is why I ask.

Streamfavourites are also not files, they reside within a shared .xml file and can't be opened with that "file":" command and
as I am an amateur I could really use an example where one can deduce the needed JSON link from either

* A simple working example, which is what this thread OP and the first few replies were about

* the response to http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Favourites.GetFavourites","params":{"properties":
["window","path","thumbnail","windowparameter"]},"id":1}

* JSON-RPC-Browser (which is what I have used to build 50 commands or so, fantastic tool) I can get the favorites there too
but not build complete JSON links as with other links.

* directly from the .xml file

ah well,
Reply
#14
Well as a last answer, but maybe it will help you understand your problem Smile

You are just repeating here, it does not work, there's no doc and bla bla, but never says what you try, what are the errors, and where you are blocked.

You just say give me the solution to my 10% described problem.

Your question about the response to the GetFavourites is the first post of this thread, what to do with it, is the 3rd answer to this thread and in my given answer Wink So please if you want help from someone else, you should at least try to detail your problem correctly Wink
Reply
#15
Ok my last answer too Wink

The third post gives an example that is explicitly not working, asked by the guy who is threadstarter and uses GUI.ActivateWindow
which will not work to play a stream as I understand it.
The OP is what is what I am tacking my question on to in a me-too-sort of way, as he gave the example and I have the same problem.
But never mind
Reply

Logout Mark Read Team Forum Stats Members Help
Play favorites using json0