JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174) +---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-05-20 Are you serious ? None of your sample does looks like those in this post. Either you use a very recent Gotham and the params must looks like "params": { "showhidewatched": true} Or use the Player.Open with all params in the URL to bypass the bug. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-05-20 Sorry, i tested again in another xbmc version and its working: Quote:{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params": { "addonid":"script.cavplus","params":["showhidewatched=true"]},"id":1}Was a stupid mistake mine, i install a script with a different name in the addon.xml. The other stupid mistake, i forgot to insert the "Key" in the params: Quote:{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params": { "addonid":"script.cavplus","params":{"showhidewatched":"true"}},"id":1}I believe that the code above will work too. Clayton RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-05-20 Buy the way Tolriq, i am always serious. I made my request based on the examples on the topic, of course, i put my "codes". RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-05-21 When retrieving sources with Files.GetSources, is there no way to obtain the "content" type for each source (ie. none, movies, music videos, tvshows)? This would be very useful. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-05-24 Hi How can i insert several files at once in a Playlist using Playlist.Insert? Can i made a "chain" insert ? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-05-24 You can't you can only use batch commands. multiple json commands in a [] Be aware that the Team have said that in the future batch commands can be treated in any order and so that batch commands may in the future not insert the media in the correct order. Leaving to no official long living solution but making lots of requests. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-05-24 (2013-05-24, 13:03)Tolriq Wrote: You can't you can only use batch commands. multiple json commands in a [] Very thanks Tolriq, i have this similar problem with my interface since i am using javascript. If i try to get all the episodes with a playcount = 0 and then insert in a playlist i will always have a out of order episodes numbers, since all my requests are asynchronous i have to use a setTimeout function, its not a good thing to use. For now i have to use a smartplaylist or a little script that i made. The best for me to get this working (easily insert non watched episodes in a playlist) is using the script Quote:def _unWatchedEpisodes(self):If i use this i can insert all the non watched episodes at once and i will avoid to use another loop in my interface. Maybe i am missing something and there is another easy way to do this directly in the JSON, i dont see in the Wiki, but maybe i am missing something. Clayton RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Fuzzwah - 2013-06-16 I'm running XBMC Frodo and having an issue trying to kick off playback of music from a m3u playlist using the JSON api. I've confirmed that my playlist works fine when I start playing it via the GUI. But when I fire the following API call I get shown an empty black screen: Quote:curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/music/QueensOfTheStoneAge-LikeClockwork.m3u" }}, "id": 1 }' http://localhost:8080/jsonrpc Here is the output I see from my curl command: Quote:xbian@xbian ~/.xbmc/userdata/playlists/music $ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/music/QueensOfTheStoneAge-LikeClockwork.m3u" }}, "id": 1 }' http://localhost:8080/jsonrpc If I then check what is in the playlist I see that it is empty: Quote:xbian@xbian ~/.xbmc/userdata/playlists/music $ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{ "jsonrpc": "2.0", "method": "Playlist.GetItems", "params": { "playlistid": 0 }, "id": 1 }' http://localhost:8080/jsonrpc If I make a smart playlist which contains the following: Quote:<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> And launch it in the same way: Quote:curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/music/QueensOfTheStoneAge-LikeClockwork.xsp" }}, "id": 1 }' http://localhost:8080/jsonrpc Everything works as expected. The album playsback and I can see in the playlist: Quote:{"id":1,"jsonrpc":"2.0","result":{"items":[{"id":7327,"label":"Keep Your Eyes Peeled","type":"song"},{"id":7328,"label":"I Sat By The Ocean","type":"song"},{"id":7329,"label":"The Vampyre Of Time And Memory","type":"song"},{"id":7330,"label":"If I Had A Tail","type":"song"},{"id":7331,"label":"My God Is The Sun","type":"song"},{"id":7332,"label":"Kalopsia","type":"song"},{"id":7333,"label":"Fairweather Friends","type":"song"},{"id":7334,"label":"Smooth Sailing","type":"song"},{"id":7335,"label":"I Appear Missing","type":"song"},{"id":7336,"label":"…Like Clockwork","type":"song"}],"limits":{"end":10,"start":0,"total":10}}} My guess is that firing a Player.Open containing a m3u file is actually kicking off an image playback, rather than music playback. I base this on the output I see in my xbmc.log file: Quote:08:08:12 T:3042213888 DEBUG: We have an error loading a picture! For now I guess I am going to have to fix up all the tags in my albums and use smartplaylists. I wanted to avoid this as it is far easier for me to programatically generate m3u files. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-06-16 Well known still unresolved don't know why problem m3u are associated by default with pictures, simple solution : You just need to add the following in your advanced settings in Xbmc installation <pictureextensions> <remove>.m3u</remove> </pictureextensions> RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Fuzzwah - 2013-06-16 (2013-06-16, 17:12)Tolriq Wrote: Well known still unresolved don't know why problem Thanks! It is always so awesome when it is a 4 line fix for something you've been banging around head against a wall for a few days over. My searching for a solution here on the forums was difficult because I couldn't just search for m3u (too short!). RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Fuzzwah - 2013-06-23 I'm now having trouble trying to get my m3u playlists to be shuffled. I have tried both: Code: curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d "{ \"jsonrpc\": \"2.0\", \"method\": \"Player.Open\", \"params\": { \"item\": { \"file\": \"special://profile/playlists/music/NiN.m3u\" }, \"options\": {\"shuffled\": true}}, \"id\": 1 }" http://192.168.0.16:8080/jsonrpc And, after kicking off playback of a playlist I've tried: Code: curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d "{ \"jsonrpc\": \"2.0\", \"method\": \"Player.SetShuffle\", \"params\": { \"playerid\": 0, \"shuffle\": true}, \"id\": 1 }" http://192.168.0.16:8080/jsonrpc Both of these give me responses which make me think they've worked: Code: {"id":1,"jsonrpc":"2.0","result":"OK"}* Closing connection #0 But there is no shufflage going on. Any tips as to what I'm doing wrong? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-06-23 This is strange behavior of Xbmc but opening an m3u is seen in xbmc as a single file and not multiple ones added to a playlist. So there's no way to shuffle it. This make me think that i saw a pr that changed the next / previous behavior should be tested in this situation. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Fuzzwah - 2013-06-24 (2013-06-23, 22:40)Tolriq Wrote: This is strange behavior of Xbmc but opening an m3u is seen in xbmc as a single file and not multiple ones added to a playlist. Bummer. Thanks for the info. I guess for now I'll whip up bash script which shuffles the lines in the file before I pass it off to xbmc. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-06-24 Well if you go with script you should perhaps just read the m3u and add files to Xbmc playlist, this would allow much better control after since all files would be in the playlist. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Kabooga - 2013-06-24 It seems I can get a loaded playlist to shuffle. Here are the api commands I used. Code: {"jsonrpc":"2.0","method":"Playlist.Add","params":{"playlistid":0,"item":{"directory":"special://profile/playlists/music/doo.m3u"}},"id":1} and Code: {"jsonrpc":"2.0","method":"Player.SetShuffle","params":{"playerid":0,"shuffle":true},"id":1} The biggest difference I can see is using Playlist.Add instead of Player.Open. Hope this helps. |