Kodi Community Forum
WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps - 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)
+--- Thread: WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps (/showthread.php?tid=8760)

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


- LiquidIce629 - 2006-02-16

sorry if this has been asked before, i could not find the answer. i am am making some good progress on an ajax frontend for xbmc. i'm trying to get cover art displayed in the pages.

i send this command:
/xbmccmds/xbmchttp?command=gettagfromfilename&parameter=smb://user:[email protected]/mp3s/albums/311%20-%20from%20chaos/11-311-uncalm-apc.mp3

it returns:
artist:311||album:from chaos||title:uncalm||track number:11||duration:191||genre:alternative||release year:2001||thumb:[none] q:\albums\thumbs\4ce1aa7c.tbn

is there a url to access q:\albums\thumbs\4ce1aa7c.tbn
can we somehow share this folder on the webserver so the images can be displayed on a webpage?


- kraqh3d - 2006-02-16

there is a "getthumb" command which takes that as its parameter. looking over the code, it sends the file back encoded in base64.


- LiquidIce629 - 2006-02-16

it could be my album art setup...

i'm doing this for an album that shows cover art in the main xbmc tv interface.

so i take a song in that album and do a gettagfromfilename and it retuns back info including a thumb location.

so then i send:
/xbmccmds/xbmchttp?command=getthumb&parameter=q:\albums\thumbs\4ce1aa7c.tbn

and i do not get anything back.

if i could get the raw data back this might work for displaying the image in the browser:

Quote:<img src="data:image/png;base64,ivborw0kggoaaaansuheugaaadiaaaaycayaaaa ep4ixaaaalhrfwhrdcmvhdglvbibuaw1lafr1zsaynibpy3qgm jawncawmdowndoymcatmdawmmdfy6eaaaahdelnrqfuchkxbtf %2bercsaaaacxbiwxmaaassaaaleghs3x78aaaabgdbtueaalg pc%2fxhbqaab1rjrefuenrvmhlwu1uuxr%2bbrunalfaqvpawp sll6iigqnfhm1fzbhwoa6igiaucqknkko5qzbmvwxsgkg7jifq 6mikaidgovxfq%2famvkuktvqb2ou3sbnfvrouxns1lg0g4haa vl%2ffm3r%2fnno%2bc8wqut%2buujjzldnap8sgrm8l0blqpf k5zzbbms6hfqruqwfwm2csfeu%2f4kthqj0o0txag2wxifnkhx 9zymcu4euonbmkp%2bf5i%2bcyxbugswl5tgsvpajc9kz6l64p %2bgmh1nzw6ab8yla3dfte3qplefmizuvc8zm7eop9a6p%2b5j mmpzghiokp4esuvsllijlijtkj%2f35r26asgmd5mpxizbh93c j8u8jbbizqx%2bzvx9dhpkr7ooeoxhn%2famljoflpqeq2drqx 8%2bn%2fhgoieh76%2ffcwr%2b%2bmu6zqxd1yknapbr%2fncc dtikbt0iuia4ultuieynrgkqlkhdmcr3owuee%2ffikf8ebjyc baybbkh9%2f9pxuvbarrhrvxcy0h8qmiu5ceeryivkwmgdkegz qmsq%2br8hweefyryzlveqhueoxexy33zwjgtcullxrtyjesut pz8ayxzvgvx96pqerpibrvh2jwaqxng4agqemp24n3fhhsuv6b sev8srbsfcstg2o1hgbu1imwkgjxgnyeynvyomk8lldjkdunz5 mkxkumv2bvwhgr8rkhqeqlo1%2fvkpe49g99guobqfqdzqrfesvsu%2fzgaye5000h3%2bm24m3m6wgdua qgse4wcu83ldwu483b9z%2bv70sahrkc71xlh7ddstegaiyybk 1ge8cfode2fzb2ncaksmz7ozgdst0pn9byra%2bb1yd08obblm y4qvowuxa85vowsvybqi%2bkpalswkamnijmwfhgs6bx%2fb1e j9sbh5ljwhdflzqrx%2bpc%2bsq2niryd4mhbmoi2heeklfrgk nad2vgnjfj5dwloht%2bd3x%2bfeq0grm4j6qlizhow2neowg5 h8on4ahera7dwiulsb2sqhvco4komecwva1bbe3ts%2bjs72gc 9u6aphdoov3mz3gv21iz0wh0i2fqv7iijpy8q1zwnnph7om%2b dcwdhojhgxonyb%2f8mqnj4%2faszrj3mixcswibyv1cad3w78 k6d%2bttvcft3ja3nvgvswd9zd4vhext7gaqz28sd8mccgxoub d2xnoczliowxkwx7dzih3eqr8kx7qr6phzntodar4thyny7ddd 3xqaravf1unhghkmlvlsfawgc6d4f4ivrb%2ftttokefsbs%2b sqlncxngq%2fjlw9iem7aqwaiosymycghjoekeobsgaqlrtiou ksmmiwib4kqpgtwqeu8viaz03nlpwufqbwp16oppgrp2rlgxcn ppwiboicmxihwx2ufuar1qlzukmbjh8%2fhj8kiolangraffmr k0mjw%2fnctivnbz0aw6y0wzbaiputzstaxn27r9j%2bkfgoln tvsgsvzfi7nrskteh6qcbazzeam3nhlkn9jmaig0hqdje9mffm swigufyj3pvvkpjih7a9qzo%2bgc66wqeg9xct6m5hxffhn%2f zlsh2do5u4vc83dkgxs%2br1ukf%2befl6sebgibddh4ul4qfq w%2bcjbmjeoik81sejlr0ainrgx7jyqijf40kylk%2f0b4npkylmvvmml1tif1xqip0gljnlbhczdf60dmulskvff74ybchitm 4q3qa1gu8tc%2bpahhroz0bzoldmgidwojmntqhkdpqgoqwnml 7vpysxk8ituqjwzyqgmwag%2bblvrdzhbzirgmq1mbtv2si8ja xpbb8srfgnyjfw8g0x5kbesqave1odg1z6gmgq2malkac16kw% 2fnqlewnjkmwy7ur4%2fothsxfxncmygxlzuyudwezugaluqp4 wilneui2ojyleumqpmoipyk%2fbmp7wtq9b6wyfmo86g4roics el4qdjqourwy0whwmqjjx75grbzchhpedeqjmvjz%2flyjyggo o1cmk2hzhc2bgfz27gvzwg%2fcmfyomiukadlfkkzga1zerpei %2bhtvslieekzzgnnb1qsgsnligaeh6qk5cfdcpvcre4nmrqm1 shftkicv5qqfhd%2bo8%2f%2bqmbx9h4taclxfqsfvdwozl6ue hugv7nknz3djofwqxychevsxcz54cm8lbb1ie7o1vu%2blyw16 l1scygaohg11%2fxkxynpwyltozjen01vaoumuyw1mte1d9sro glxaaqwjmir4tmoyk%2f3nildmmz2ukdx11wqp7bhlec2vogfs 6mjcqgejhkinzfx2hzaru5mydgxsxwgicowauhzsbn2tbnmhae zcdggcarr5nkgzl8czpibfngrgcd1gak7msuvlfa5dbi%2f4rw 51lulw0s5y0%2bmbqhldcwpiewmb6b1rpi6dmqw863idr8xdsh d3k%2bx080r9yvwnskcks9etxkbkdplby02091wjdzdl%2bgn9 ekt1i3adwu4uwwichpwtpslua7umdvfxyyaaaaasuvork5cyii %3d" alt="your browser does not support this" title="">






- TeknoJuce - 2006-02-16

you could use xboxip/xbmccmds/xbmchttp?command=takescreenshot&parameter=test.jpg;true;0;300;200;90;true for now cuz i know that it returns its base64 code for the image for a quick test on that varibles you have above..






- kraqh3d - 2006-02-16

the command simply returns the raw base64 data sourrounded by <html> ... </html>.

but, the command could be modified to accept an additional parameter to encapsulate the base64 data as in your example. lemme take a look.

** edit **
done... add ;imgtag to the end of the string to return it in imgtag format. since the command is getthumb, it assumes that the image type is jpeg as thats what we use.






- TeknoJuce - 2006-02-16

not that it matters much cuz the getthumb code is still there but the name is acaully filedownload now not getthumb.. Smile

Quote:name changes

to make the names of the commands more logical some have been changed. the old names are still recognised but it is strongly advised that the new names are now used.

old name | new name
--------------------------------------
copyfile | filecopy
deletefile | filedelete
getinternetfile | filedownloadfrominternet
getthumb | filedownload
guisetting | setguisetting, getguisetting
setfile | fileupload
setkey | sendkey






- kraqh3d - 2006-02-16

yeah i noticed that after i commited the change. i'm actually making a bit of a modification to it because of this. i think its best if getthumb only accepted the imgtag parameter since it makes the assumptiont that youre getting an xbmc thumb. the other command can still be available to download *any* file but it wont make any assumptions about the file type.


- TeknoJuce - 2006-02-16

not quite sure what this really does yet im compiling now but im guessing it will display the image instead of the base64 code if so did you want to add the option also to getscreenshot. Smile

id probably give the option to filedownload also because theres no harm in that.. what if you would want to download something other then thumbs but maybe pictures off the xbox drive ? Smile






- kraqh3d - 2006-02-16

yes, it actually displays the image in your browser instead of the raw base64 text. and yeah, i can probably add the same to getscreenshot.

did you try out the playfile change?

** edit **
takescreenshot is very complex. it accepts several options. it looks as though you need to supply all the options and true at the end to force a base64 download, so i think it only makes sense to add this option like this:

&parameter=filename;flash;rotation;width;height;quality;true;imgtag

agree?






- TeknoJuce - 2006-02-16

i will soon as this is done compiling, i spent all last night converting base64 to ascii and then outputting the jpg strange how this comes up now hehe..


Image
Image






- kraqh3d - 2006-02-16

this option will only help you if you're remote control code is all browser based.


- TeknoJuce - 2006-02-16

yeah i was thinking about making an html inline frame or something of the sort..


- kraqh3d - 2006-02-16

done... add ;imgtag after the download option in takescreenshot.


- TeknoJuce - 2006-02-16

awesome great job asusual kraqh3d! :o  
did you read the comment about filedownload also above that i sliped in there before your first responce..
Quote:id probably give the option to filedownload also because theres no harm in that.. what if you would want to download something other then thumbs but maybe pictures off the xbox drive ?
unless of course the getthumb adition means its in the filedownload already concidering its all in the same.






- kraqh3d - 2006-02-16

yes, i did. i did a little change so that the "imgtag" parameter only works with "getthumb". if you use "getthumb", it assumed that you're fetching an xbmc thumb, therefore we can assume the mime type is jpeg. the newer "filedownload" command ignores this parameter, and only returns the raw base64.

heh, i'm just sitting at my computer, hitting refresh over and over again to keep updating the screenshot in my browser Smile