Ruby JSON RPC API Client

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
TheDeadSerious Offline
Junior Member
Posts: 10
Joined: Nov 2010
Reputation: 0
Star  Ruby JSON RPC API Client
Post: #1
Hi Folks,

just wanted to let you know that I've created a (very alpha and basic) Ruby client for the JSON RPC API.

It does not explicitly define all the classes and methods in the source code, but rather builds itself on the fly by calling JSONRPC.Introspect and then dynamically defining all namespaces and methods, so with very little code, the API is (kind of) covered completely.

You can find the source on Github:

It is available as a Rubygem "xbmc-client", see the gem website at

I've only tried it with the AudioLibrary and AudioPlayer API so far, but I don't see a reason why it shouldn't work for the other API requests as long as there are no quirks in certain API calls that I'm not aware of.

I've also filed a related feature request for the JSON RPC API on Trac:
find quote
spiff Offline
Retired Developer
Posts: 12,384
Joined: Nov 2003
Post: #2
damn that's beautiful code Smile
find quote
TheDeadSerious Offline
Junior Member
Posts: 10
Joined: Nov 2010
Reputation: 0
Post: #3
spiff Wrote:damn that's beautiful code Smile

Thanks mate Wink
find quote
topfs2 Offline
Team-Kodi Developer
Posts: 4,548
Joined: Dec 2007
Reputation: 17
Post: #4
I must say, building the methods on the fly is so beautiful I want to cry Smile Perfect example why we added the introspect.

Great job! Hope to see some awesome clients thanks to this!

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
TheDeadSerious Offline
Junior Member
Posts: 10
Joined: Nov 2010
Reputation: 0
Post: #5
Thanks again Smile

I'm currently working on a music web client based upon this with Rhythmbox/Itunes-ish UI. Basic stuff is (kinda) working already, but it will need a lot more work - no real UI at the moment. We'll see...
find quote
Walter Sobchak Offline
Junior Member
Posts: 42
Joined: Sep 2011
Reputation: 0
Post: #6
Very nice usage of the ruby language! Now wouldn't it be nice if we could write addons for xmbc in ruby? Wink
find quote
Phobia Offline
Junior Member
Posts: 24
Joined: Oct 2007
Reputation: 0
Post: #7

Firstly - sorry for dragging up such an old thread.

I've recently found an interesting Ruby client for AirVideo - a Windows and Mac based Server which transcodes content on the fly (on the remote side) primarily for consumption over the Internet.

The server was developed for iOS devices (iPhone/iPod/iPad etc.). One installs the "Server" component on their machine at home with enough horsepower to transcode video, and the AirVideo "App" on their iDevice to stream that content on the road.

I've been looking for a way to add a remote video source to XBMC that would be capable of traversing a WAN connection, served by a typical home Internet connection. As most of my content is 720p+, that really means there is a need to transcode due to limited available bandwidth. I use AirVideo on my iPhone, and if you have a recent build of XBMC running, you can use Apple's own AirPlay technology to achieve this already, but that requires an iDevice to leverage.

I'd like to be able to eliminate the iDevice, and instead stream directly from the Server to the remote XBMC client.

Here is the link to the forum post which in turn links to the software (including source) :

Here is the post inline as well :

Air Video Client for Windows: [url][/url]
Requirements: Windows XP or later. For live conversion, .NET framework 4 is required, and if you are using Air Video Server 2.4.3, download Elecard AVC HD Player (trial version), and locate the player in the client app. For Air Video Server 2.4.5beta users, locate a VLC media player in the app. TCP port 8008 must be opened for live re-streaming proxy.

[03/22/2011] Re-implemented by wxRuby
[03/25/2011] Mod for Ruby 1.9. HTTPLiveStreamingProxy is now isolated from the client app.
[03/28/2011] Playing with live conversion is now available on Windows XP or later with Elecard AVC HD Player.
[03/29/2011] Tests on pseudo-seek during live conversion.
[03/31/2011] Now compatible with AirVideo Server 2.4.5beta (playback/livePlayback-2.4).
[04/01/2011] Fixed wrong live playback starting points, etc.
[04/03/2011] HTTPLiveStreamingProxy was re-written by C#, which resulted in less memory usage. Add manual bitrate selection / recording buttons.
[04/07/2011] Fixed live conversion request method (now all movies could be played by live conversion)
[04/07/2011] Abort the development because much better solution has been found. See pavram's post on 5th Apr 2011.
[05/31/2011] Temporal fix of encoding problems (UTF8-MAC) on AirVideo Server 2.4.5beta6 Mac
[12/18/2011] Context menus for sorting options were added for my personal use. Recompiled with Ruby 193p0 and Ocra 1.3.

Is a Ruby client like this something which can be made to work with XBMC? Not being one who can program, I have little to no idea.


-- Phob
find quote