Giter Site home page Giter Site logo

sardavend / python-xbmc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jcsaaddupuy/python-xbmc

0.0 2.0 0.0 311 KB

Simple python module that allow xbmc full control over HTTP Json API.

License: Do What The F*ck You Want To Public License

Python 100.00%

python-xbmc's Introduction

Latest Version Supported Python versions Wheel Status License

python xbmc json client

Simple python module that allow xbmc control over HTTP Json API. Virtually support all availables commands.

Install it :

pip install xbmc-json

Usages examples :

Client instanciation

from xbmcjson import XBMC, PLAYER_VIDEO
#Login with default xbmc/xbmc credentials
xbmc = XBMC("http://YOURHOST/jsonrpc")

#Login with custom credentials
xbmc = XBMC("http://YOURHOST/jsonrpc", "login", "password")

Ping XBMC

print xbmc.JSONRPC.Ping()

UI interaction :

# Navigate throught windows
xbmc.GUI.ActivateWindow({"window":"home"})
xbmc.GUI.ActivateWindow({"window":"weather"})

# Show some notifiations :
xbmc.GUI.ShowNotification({"title":"Title", "message":"Hello notif"})

# ...and so on

Parameters can alos be passed as python parameters:

xbmc.GUI.ActivateWindow(window="home")
xbmc.GUI.ActivateWindow(window="weather")
xbmc.GUI.ShowNotification(title="Title", message = "Hello notif")

Library interaction :

xbmc.VideoLibrary.Scan()
xbmc.VideoLibrary.Clean()
# ...and so on

Everything to build a script thats act as a full remote

xbmc.Application.SetMute({"mute":True})
xbmc.Player.PlayPause([PLAYER_VIDEO])
xbmc.Player.Stop([PLAYER_VIDEO])
xbmc.Input.Left()
xbmc.Input.Right()
xbmc.Input.Up()
xbmc.Input.Down()
xbmc.Input.Back()
xbmc.Input.Down()
xbmc.Input.Info()
# ...and so on

See http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6 for availables commands.

Every XBMC namespaces are accessible from the instanciated xbmc client.

Every commands presents in the API documentation should be available.

You can take a look at xbmc-client for an implementation example.

Contribute

Please make your PR on the branch develop :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.