mrkipling / maraschino

A front-end for HTPCs
MIT License
424 stars 125 forks source link

Boxee[box] support? #13

Open ghuntley opened 12 years ago

ghuntley commented 12 years ago

No doubt, I won't be the last person to seek Boxee integration.

Relevant (python) example: https://github.com/cold12/Trakt-for-Boxee

Documentation: http://developer.boxee.tv/

Let's get the ball rolling shall we?

ghuntley commented 12 years ago

Communication is done directly via TCP on _boxee-jsonrpc._tcp (typically port 9090)

ghuntley commented 12 years ago

Methods available without authentication

Media Sources

Command

{"jsonrpc": "2.0", "method": "Files.GetSources", "params":{"media": "video"}, "id": 1}

Result

{"id":1,"jsonrpc":"2.0","result":{"limits":{"end":2,"start":0,"total":2},"shares":[{"file":"smb://NAS/media/tv/","label":"tv on NAS"},{"file":"smb://NAS/media/movies/","label":"movies on NAS"}],"success":true}}

Invoking Playback

Command

{"jsonrpc": "2.0", "method": "XBMC.Play", "params":{"file": "smb://NAS/media/tv/How I Met Your Mother/Season 07/How I Met Your Mother - 7x12 - Symphony of Illumination.mkv"}, "id": 1}

Result

{"id":1,"jsonrpc":"2.0","result":"OK"}

Video Playback Play/Pause (toggle)

Comment

{"jsonrpc": "2.0", "method": "VideoPlayer.PlayPause", "id": 1} 

Result

{"id":1,"jsonrpc":"2.0","result":{"paused":false,"playing":true}}
ghuntley commented 12 years ago

Methods which require authentication

Listing files/directories

Command

{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params":{"directory": "smb://NAS/media/tv/How I Met Your Mother/"}, "id": 1}

Result

{"id":1,"jsonrpc":"2.0","result":{"files":[{"file":"smb://NAS/media/tv/How I Met Your Mother/Season 07/","filetype":"directory","label":"Season 07"}],"limits":{"end":1,"start":0,"total":1},"success":true}}

Command

{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params":{"directory": "smb://NAS/media/tv/How I Met Your Mother/Season 07"}, "id": 1}

Result

{"id":1,"jsonrpc":"2.0","result":{"files":[{"file":"smb://NAS/media/tv/How I Met Your Mother/Season 07/How I Met Your Mother - 7x12 - Symphony of Illumination.mkv","filetype":"file","label":"How I Met Your Mother - 7x12 - Symphony of Illumination.mkv"}],"limits":{"end":1,"start":0,"total":1},"success":true}}
ghuntley commented 12 years ago

Authentication

Pairing

Command

To Initiate pair device, this will popup a window on your boxee with a code, "deviceid" can be anything, but it really should be the macaddress of the device your connecting from:

{"jsonrpc": "2.0", "method": "Device.PairChallenge", "params": {"deviceid": "6c:f0:49:58:d5:48", "applicationid": "Maraschino", "label": "Maraschino", "icon": "http://www.maraschinoproject.com/static/images/maraschino_logo.png", "type": "other"}, "id": 1}

Response:

{"id":1,"jsonrpc":"2.0","result":{"success":true}}

To Finish Pair device, "code" is the number that pops up on boxee after pair challenge command sent :

{"jsonrpc": "2.0", "method": "Device.PairResponse", "params":{"deviceid": "6c:f0:49:58:d5:48", "code": "1234"},"id": 1}

Connecting / Authenticating

To connect , this is really important. Its what gives to permissions to access the other methods

Command:

 {"jsonrpc": "2.0", "method": "Device.Connect", "params":{"deviceid": "6c:f0:49:58:d5:48"}, "id": 1}

Response:

{"id":1,"jsonrpc":"2.0","result":{"success":true}}
mrkipling commented 12 years ago

I don't use Boxee and don't have much interest in supporting it myself, but if a developer who uses Boxee wants to come along and add support for it then that is totally cool :)

devinjames commented 9 years ago

What sort of functionality would you like ghuntley? I've gone through the v1 API's for XMBC (which are undocumented) by trying out XBMC API v2 commands and it doesn't look like the API included on boxee has any Library commands to get recent movies or tv shows, so control functionality is pretty limited. I recommend upgrading your boxee to Kodi 13 which is available, and trying to add it as a XBMC server on Maraschino that way.