Project description
Python client for Kodi Server
This is a Python remote control for Kodi Server through the REST API
with the minimal but sufficient basic controls.
Table of contents
Installation
pip install kodi_remotecontrol
Authentication
from kodi_remotecontrol import Authenticator
kodi_ip = "10.0.0.240"
session = Authenticator(api_host=kodi_ip)
UI navigation
from kodi_remotecontrol import Navigation
nav = Navigation(session=session)
nav.press_enter()
Buttons |
Description |
press_up() |
UP button |
press_down() |
DOWN button |
press_left() |
LEFT button |
press_right() |
RIGHT button |
press_back() |
BACK button |
press_enter() |
ENTER button |
press_contextmenu() |
CONTEXT MENU button |
Player interaction
from kodi_remotecontrol import Player
nav = Player(session=session)
nav.press_play()
Buttons |
Description |
press_play() |
PLAY button |
press_stop() |
STOP button |
press_pause() |
PAUSE button |
press_shuffle() |
SHUFFLE button |
press_previous() |
PREVIOUS button |
press_next() |
NEXT button |
press_info() |
INFO button |
Subtitle selection
from kodi_remotecontrol import Subtitle
sub = Subtitle(session=session)
sub.on()
print(sub.select_next())
{
'id': 1,
'jsonrpc': '2.0',
'result':
{
'currentsubtitle':
{
'index': 1,
'language': 'fre',
'name': 'French
}
}
}
Buttons |
Description |
press_on() |
ON button |
press_on() |
OFF button |
select_next() |
NEXT button |
select_previous() |
PREVIOUS button |
Audio track selection
from kodi_remotecontrol import Audio
aud = Audio(session=session)
print(aud.select_next())
{
'id': 1,
'jsonrpc': '2.0',
'result':
{
'currentaudiostream':
{
'bitrate': 640000,
'channels': 6,
'codec': 'ac3',
'index': 0,
'language': 'fre',
'name': 'AC3 5.1(side)'
}
}
}
Buttons |
Description |
select_next() |
NEXT button |
select_previous() |
PREVIOUS button |
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution