![]() |
|
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- XBMC Community Forum (http://forum.xbmc.org) +-- Forum: Development (/forumdisplay.php?fid=32) +--- Forum: Development (/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (/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 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
- Martijn - 2011-11-05 13:52 Montellese Wrote:I'll have to see if it will increase the query retrieval time or not. Feel free to create a feature request ticket.If it won't make things. I'll create a feature request ticket anyway. Quote:I still don't understand why you guys aren't usin JSON libraries. It makes using the data from the responses sooo much easier. In your case the regex is wrong because there are no double-quotes around an integer value. Furthermore most of your regexes will fail if someone disables compact JSON output through Advanced Settings (like I have to better debug).I removedd the double quote however this created another error. You mean the way logo-downloader handles requests for how it should be coded? Well I only started to learn python couple of weeks ago so it was the choice of the other guys. So i'm just learning as i go along and just expanding the existing code. Still little lost in all the python/JSON coding
- ronie - 2011-11-05 14:20 Machine-Sanctum Wrote:You mean the way logo-downloader handles requests? there's a simplejson script module in our addon repo that could/should be used instead of doing regex matches on the results. i only found out about it last night (thanx pieh) :-) like you, i used the existing scripts as an example when i started creating python addons....guess we've all been doing it wrong right from the start. - Martijn - 2011-11-05 14:26 ronie Wrote:there's a simplejson script module in our addon repo that could/should be used instead of doing regex matches on the results. Well we took some of our code from the logo-downloader ![]() What's it called and is there a readme/example included on how to use it? Also found some cache handle script however there's no readme/examples included. - ronie - 2011-11-05 14:43 Machine-Sanctum Wrote:Well we took some of our code from the logo-downloader script.module.simplejson/ PHP Code: import simplejsonMachine-Sanctum Wrote:Also found some cache handle script however there's no readme/examples included. and you want us to guess the name of the scipt? count me in! what's the first prize? - Martijn - 2011-11-05 14:55 ronie Wrote:and you want us to guess the name of the scipt? Haha sorry forgot about that ![]() Could be wrong however maybe you can shed some light on what it actually does. http://mirrors.xbmc.org/addons/eden-pre/script.common.plugin.cache/ Sorry for the off-topic. - Martijn - 2011-11-05 16:06 EDIT: Nevermind. Found it the previous problem. Altough still have this problem: Code: if jsonobject_season['result'].has_key('limits'):Code: 15:56:06 T:1108 ERROR: Traceback (most recent call last):- Martijn - 2011-11-05 19:12 Machine-Sanctum Wrote:Altough still have this problem: I tried several things, read some documentation however i'm to inexperienced to solve the problem above on my own ![]() The rest of it all function without a problem. If some one could give a hand i would be grateful
- Montellese - 2011-11-05 20:42 I don't really know python but from looking at the code this line doesn't make much sense to me: Code: for item in jsonobject_season['result']['limits']:Code: item['total']Something like this might work Code: if jsonobject_season['result'].has_key('limits'):- Martijn - 2011-11-05 20:52 Montellese Wrote:I don't really know python but from looking at the code this line doesn't make much sense to me: Well you know enough. It worked. Thanks
- jimk72 - 2011-11-05 20:52 Thanks for the update about the onplay! I redid a lot and am now using http to get and post JSON. tcp seems fine to send json but when you recieve it(especially if getting entire artist list,4000+) it is so fragmented you have to do preparsing to make sure you have the entire request recieved. Now using http I get the entire json for each singular request. Everything works perfect. Am also using superobject to parse the json. I did have one request: does anyone know if there is a shortcut to get the image of a album that has no thumbnail, empty artist thumbnail, empty movie thumbnail? These are the images xbmc displays when no image is avail. I know I could just find them in the source for xbmc but then I am using their images in my program. I would rather either load them through http from xbmc or instead of xbmc json returning "thumbnail":"" it could return the path to the default thumbnail xbmc uses. Hope that wasnt to complicated. |