forked from jcsaaddupuy/python-xbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
27 lines (23 loc) · 1.07 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/env/python
from xbmcjson import XBMC, PLAYER_VIDEO
if __name__ == "__main__":
xbmc = XBMC("http://YOURHOST/jsonrpc")
# JSON RPC
# Ping
print xbmc.JSONRPC.Ping()
# Gui
xbmc.GUI.ActivateWindow({"window":"home"})
xbmc.GUI.ActivateWindow({"window":"weather"})
# Show a notification
xbmc.GUI.ShowNotification({"title":"Title", "message":"Hello notif"})
# Application
xbmc.Application.SetMute({"mute":True})
xbmc.Application.SetMute({"mute":False})
# Video library
xbmc.VideoLibrary.Scan()
xbmc.VideoLibrary.Clean()
# Query the video library
print xbmc.VideoLibrary.GetTVShows({ "filter": {"field": "playcount", "operator": "is", "value": "0"}, "limits": { "start" : 0, "end": 75 }, "properties": ["art", "genre", "plot", "title", "originaltitle", "year", "rating", "thumbnail", "playcount", "file", "fanart"], "sort": { "order": "ascending", "method": "label" } }, id="libTvShows")
#Player
xbmc.Player.PlayPause([PLAYER_VIDEO])
xbmc.Player.Stop([PLAYER_VIDEO])