Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kodi_client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kodi_client

  • 0.7.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RubyKodiClient

RubyKodiClient is a work-in-progress client for Kodi JSON API v12 written in ruby.

Currently implemented are the following Methods:

  • Addons
  • Application
  • AudioLibrary
  • Favourites
  • Files
  • GUI
  • Input
  • Player
  • Profiles
  • System

Installation

from rubygems using

gem install kodi-client

or from the sources using

gem build kodi-client.gemspec

and then execute

gem build kodi-client-x.x.x.gemspec

Enable Kodi Remote Control

In order to use JKodi Wrapper, Kodi remote control must be enabled. To do so perform the following steps:

1.) Go to Settings Settings

2.) Open the Services Menu Service

3.) Select the Control Tab Control

4.) Enable Remote control Remote Access

Usage

To create a client you need at least the ip and port of the kodi server

client = KodiClient.connect('127.0.0.1', 8080)

optional you can also provide authentication and if required, TLS

client = KodiClient.connect('127.0.0.1', 8080).auth('kodi', 'password').use_tls

once a client is created, all methods are available, e.g.

client = KodiClient.connect('127.0.0.1', 8080).auth('kodi', 'password').use_tls
application = client.application
gui = client.gui

with the method aquired, all calls can be executed, for example to quit kodi

client = KodiClient.connect('127.0.0.1', 8080).auth('kodi', 'password').use_tls
application = client.application
application.quit

or to play a movie

client = KodiClient.connect('127.0.0.1', 8080).auth('kodi', 'password').use_tls
player = client.player
# the file can be a local path on the server, or e.g. an upnp file url
player.player_open('path/to/file')

some calls just return a simple OK result, some also return some data, the full response is always returned in a KodiResponse, which contains any error and any result as specified in the documentation.

client = KodiClient.connect('127.0.0.1', 8080).auth('kodi', 'password').use_tls
player = client.player
# the file can be a local path on the server, or e.g. an upnp file url
player.player_open('path/to/file')
# movie started, now we can seek (assuming it is player 1) to 50% of the movie
response = player.seek(1, 50.0)
# seek returns percentage, time and total time
response.result.percentage # => 50.0
response.result.time # => { 'hours' => 1, 'minutes' => 30, 'seconds' => 0}, 'milliseconds' => 0 }

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 28 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc