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
|
- Montellese - 2011-01-05 litemotiv Wrote:Thanks for your reply Montellese. Unfortunately, replacing all the single quotes still gives a parse error. I feared as much as what you provide for the json rpc request is javascript syntax and there the single quote is alright. The question is how mootools formats the json object you provide it with and how it is sent to XBMC. Can you use something like Firebug to look at the actually sent HTTP request? This might help in locating the problem. EDIT: Just had another thought. How do you tell mootools where XBMC is located? Your url only says "/jsonrpc" but there is no IP or something like that. But as I don't know mootools anymore (last time I used it it was in the very first beta ) this is simply a shot in the dark. - litemotiv - 2011-01-05 Montellese Wrote:I feared as much as what you provide for the json rpc request is javascript syntax and there the single quote is alright. Firebug only says it is doing a post with the following data: Code: [application/x-www-form-urlencoded] So no sign of any quotes there. I'm pretty sure that the url is alright though.. - Montellese - 2011-01-05 litemotiv Wrote:Firebug only says it is doing a post with the following data: I think the problem is this: "application/x-www-form-urlencoded" Looks like mootools changes your whole request into an url encoded format as shown at the end: Code: jsonrpc=2.0&method=Files.GetSources&id=1¶ms[media]=video Code: ERROR: JSONRPC: Failed to parse ' - litemotiv - 2011-01-05 Montellese Wrote:I think the problem is this: "application/x-www-form-urlencoded" You're right, the conversion to querystring which mootools does by default is the problem... I've used a workaround for this which seems to work, but i'm going to nag the mootools developers a little to change this for json requests. Thanks for your help! - Montellese - 2011-01-06 I'd say they should convert it to a query string if you use GET but leave it as a jso object if you use POST. D'ont know if it would make sense for XBMC to support GET requests as well... - topfs2 - 2011-01-06 Montellese Wrote:I'd say they should convert it to a query string if you use GET but leave it as a jso object if you use POST. D'ont know if it would make sense for XBMC to support GET requests as well... It may be be arguably sane, i.e. it may be no problem accepting GET also, but jsonrpc spec regarding http communication states post to be used for the json object. I know some servers accept RESTless stuff though. - Montellese - 2011-01-06 topfs2 Wrote:It may be be arguably sane, i.e. it may be no problem accepting GET also, but jsonrpc spec regarding http communication states post to be used for the json object. I know some servers accept RESTless stuff though. I just checked and the JSON RPC 1.1 specification has a definition for HTTP GET (http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html#GetProcedureCall). But it states that HTTP GET does not allow json objects as parameters which is kind of a huge drawback. - litemotiv - 2011-01-06 Montellese Wrote:I just checked and the JSON RPC 1.1 specification has a definition for HTTP GET (http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html#GetProcedureCall). But it states that HTTP GET does not allow json objects as parameters which is kind of a huge drawback. I would be pretty nice to accept json objects through post, and querystrings through get? - Mindzai - 2011-01-07 Hi all, I'm having a problem using the TCP transport via PHP's sockets implementation. I am using the following code: PHP Code: $buffer = ''; However this produces an infinite loop. If I check the data from socket_read, I see that I'm getting the same data each time, ie the first 1024 bytes of the response, so the loop never terminates. Is there something I'm doing wrong here? EDIT: Seems its not an infinite loop but rather the socket is blocking. If I use socket_recv with the MSG_DONTWAIT flag I get an error: Code: unable to read from socket [11]: Resource temporarily unavailable EDIT2: Never mind. I guess XBMC is not sending any kind of EOF character or otherwise to indicate the end of a message so the socket blocks while it's waiting. I ended up just counting the number of { and } characters in the response, though it seems messy to me. - litemotiv - 2011-01-09 This was probably asked before, but is there or will there be a sortmethod for the audiolibrary available ? - litemotiv - 2011-01-09 I'm also experiencing some kind of strange bug: when i retrieve AudioPlaylist.GetItems while audio is playing, XBMC dies. The music keeps playing until the song is finished, then X (linux here) crashes and drops to the shell. Any ideas on how to debug this? All other rpc calls work without problems. - topfs2 - 2011-01-09 litemotiv Wrote:This was probably asked before, but is there or will there be a sortmethod for the audiolibrary available ? Every call to get a list has a sorting option you may use. - Montellese - 2011-01-09 litemotiv Wrote:I'm also experiencing some kind of strange bug: when i retrieve AudioPlaylist.GetItems while audio is playing, XBMC dies. The music keeps playing until the song is finished, then X (linux here) crashes and drops to the shell.First thing might be to enable debug logging in XBMC and then reproduce the problem and check the debug log (and pastebin it). I'll see if the problem exists on Windows and report back. EDIT: Seems to work properly on windows. Made several calls to AudioPlaylist.GetItems and nothing out of the ordinary happend. Is it with all songs/albums/playlists? topfs2 Wrote:Every call to get a list has a sorting option you may use.Last time I used it I thought it didn't work properly but I didn't investigate further (but it's on my TODO list). - litemotiv - 2011-01-10 Montellese Wrote:First thing might be to enable debug logging in XBMC and then reproduce the problem and check the debug log (and pastebin it). I'll see if the problem exists on Windows and report back. I can reproduce it 100% so far, xbmc completely crashes (happens with all songs/albums/etc). Both with Library and file browser. This is on Arch linux, kernel 2.6.36 and kernel 2.6.37, xbmc 10.0 release version. Request: Code: X-Request:JSON Log: Code: 13:25:37 T:139820897503296 M:1447632896 DEBUG: CGUIInfoManager::SetCurrentSong(/home/ollie/music/downloads-check/Higher Limits presents Promised Land Volume 2 - mixed by Fabio/Promised Land 2 CD2 - Unmixed (1996)/01 - Crystl - Paradise.flac) - litemotiv - 2011-01-10 topfs2 Wrote:Every call to get a list has a sorting option you may use. I can't seem to get it working, what would be the sortmethod parameters for retrieving the album or artists lists, ordered by name/title? Do they use the database fields, or something else? I've tried stuff like this: Code: {"jsonrpc":"2.0","method":"AudioLibrary.GetAlbums","id":1,"params":{"sortmethod":"strAlbum","start":0,"end":10}} |