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
|
Consider that... - ncarthy - 2011-01-19 ... if you're writing a regular expression bear in mind that the order of the fields can change... filename might not always be the first field you encounter - topfs2 - 2011-01-19 Aouch, I missed that. I'd suggest you looking at some of the many parsers for json out there already, why reinvent the wheel - Xedar - 2011-01-19 Do you mean JSON output from XBMC sometime exchange the fileds or the "client" exchenge them? so far it has never happend, i think iviewer read the whole output then parse it from top to bottom. @topfs2 save the ID variable somewhere in the memory is not possible in iviewer in a good way... well I may endup having a parser server in the middle, but it feels clener to have ipad talk to XBMC by it self. Regards - Fiasco - 2011-01-19 Xedar Wrote:Do you mean JSON output from XBMC sometime exchange the fileds or the "client" exchenge them? JSON is a layer of crap you don't want for iViewer. Install an apache webserver and use Perl to query the xbmc databases directly. You can format your query responses in nice flat easily parseable delimited text. In addition, xbmc doesn't have to be running to query. - topfs2 - 2011-01-19 Fiasco Wrote:JSON is a layer of crap you don't want for iViewer. Install an apache webserver and use Perl to query the xbmc databases directly. You can format your query responses in nice flat easily parseable delimited text. This is deprecated and will be removed eventually.. Xeder, read the json specification. It is an object Code: { "jsonrpc": "2.0", "method": "JSONRPC.Ping", "id": 1 } Code: {"method": "JSONRPC.Ping", "id": 1, "jsonrpc": "2.0" } And XBMC will always follow jsonrpc 2.0 specification, what you are suggesting is not technically in violation but it is real unnecessary and will never be added. - panos_k75 - 2011-01-19 i would like to initiate a video library scan from my client. Is there a way for my client to be notified when the scan is complete? - Fiasco - 2011-01-19 topfs2 Wrote:This is deprecated and will be removed eventually.. How can external queries of the database be deprecated? - jmarshall - 2011-01-20 We'll arbitrarily rearrange the tables :p - topfs2 - 2011-01-20 Fiasco Wrote:How can external queries of the database be deprecated? Because its silly and not sane at all to assume one table layout. Also its a giant security failure - topfs2 - 2011-01-20 panos_k75 Wrote:i would like to initiate a video library scan from my client. Is there a way for my client to be notified when the scan is complete? IIRC there is no way, please add a feature request ticket because its for sure a sane feature. - Fiasco - 2011-01-20 jmarshall Wrote:We'll arbitrarily rearrange the tables :p Bwahhahahahah touché! - Fiasco - 2011-01-20 topfs2 Wrote:Because its silly and not sane at all to assume one table layout. Also its a giant security failure You lost me. How is it a giant security failure? Yes, the table layout could change but tweaking a select statement is pretty straightforward. - wuench - 2011-01-20 Xedar Wrote:Hi! JSON parsing from scratch IS difficult. My solution is probably going to be to give up on the raw socket interface and switch to HTTP, then you should only get a single response (or maybe limited number of responses) per request so it is easier to delineate messages, rather than an endless stream. With no unique EOM, the socket interface seems like it has a high risk of getting out of sync if something gets mangled, even with a proper JSON parser. It will take a lot of extra code to protect against those issues. - topfs2 - 2011-01-20 wuench Wrote:JSON parsing from scratch IS difficult. My solution is probably going to be to give up on the raw socket interface and switch to HTTP, then you should only get a single response (or maybe limited number of responses) per request so it is easier to delineate messages, rather than an endless stream. TCP guarantees packet order and packet arrival, if it looses packets it will be resent and if it looses the entire stream it will give you a proper error for that. There exist proper stream parsers or you can use a proper jsonrpc client and it should work. That being said, http is usually simpler if you want to just use a parser. Fiasco Wrote:You lost me. How is it a giant security failure? Anyone having access to the database can both read, edit and completely destroy the database at a there leisure. This is something which is not at all good, something which should be sandboxed and impossible for a client to do unless explicitly allowed to do, which is what jsonrpc sets out the fix. Fiasco Wrote:Yes, the table layout could change but tweaking a select statement is pretty straightforward. It is, but why should a client need to do this at every release. i.e. it needs to first parse out what version XBMC is then it needs to create the select statement. XBMC handles this perfectly in the GUI code and a client should ideally be able to just ask "Get all movies" and the it should get them, no matter what version the database is. This is why jsonrpc is design how it is. Cheers, Tobias - Pr.Sinister - 2011-01-20 Hey guys... Super noob here...please be gentle... I am trying a few things using the python script from the 1st page and i have 2 problems : #1) When running the python script, it takes about 15 seconds before the urlopen executes... any idea why? This is the source : Code: import json #2) What is the proper syntax for VideoPlayer.SeekPercentage ? I have tried pretty much everything i can think of including : Code: {"jsonrpc": "2.0", "method": "VideoPlayer.SeekPercentage", "params": {"": "50"}, "id": "1"} Help! |