The KodiRPC documentation can be viewed on (http://kodi.wiki/view/JSON-RPC_API/v6)
You can clone the KodiRPC repository in any path.
git clone https://github.com/MetaphoricalSheep/KodiRPC.git
Specify your kodi connection settings in your *.config file
<appSettings>
<add key="Debug" value="false"/>
<add key="KodiUsername" value="kodi"/>
<add key="KodiPassword" value="kodi"/>
<add key="KodiHost" value="http://localhost"/>
<add key="KodiPort" value="80"/>
</appSettings>
Setting the debug key to true will output the request info on every request that you make. Useful for debugging, terrible for production.
All the KodiRPC methods are exposed through the KodiService class. Instantiate an instance of the class to get started.
using KodiRPC.Services;
var service = new KodiService();
You can use the Ping()
method to ping Kodi:
var ping = Service.Ping();
Console.WriteLine(ping.Result);
You can use the GetTvShows()
method to get all tv shows:
var parameters = new GetTvShowsParams()
{
Properties = TvShowProperties.All()
};
var shows = Service.GetTvShows(parameters);
Console.WriteLine("First Show Title: {0}", shows.Result.TvShows.First().Title)
The parameters
variable is used to specify the payload for the method you are calling. You can set Filter, Limit, Properties and Sort depending on the method. Some methods, like the Details methods, require an id as well.
You can use the GetTvShowDetails()
method to get detailed data about a specific show:
var parameters = new GetTvShowDetailsParams()
{
TvShowId = 54,
Properties = TvShowProperties.All()
};
var details = Service.GetTvShowDetails(parameters);
Console.WriteLine("Show Title: {0}", details.Result.TvShow.Title)
- Addons
- Application
- AudioLibrary
- AudioLibrary.Clean
- AudioLibrary.Export
- AudioLibrary.GetAlbumDetails
- AudioLibrary.GetAlbums
- AudioLibrary.GetArtistDetails
- AudioLibrary.GetArtists
- AudioLibrary.GetGenres
- AudioLibrary.GetRecentlyAddedAlbums
- AudioLibrary.GetRecentlyAddedSongs
- AudioLibrary.GetRecentlyPlayedAlbums
- AudioLibrary.GetRecentlyPlayedSongs
- AudioLibrary.GetSongDetails
- AudioLibrary.GetSongs
- AudioLibrary.Scan
- AudioLibrary.SetAlbumDetails
- AudioLibrary.SetArtistDetails
- AudioLibrary.SetSongDetails
- Files
- GUI
- PVR
- Player
- Playlist
- System
- VideoLibrary
- Kodi
Copyright (C) 2016 Pieter-Uys Fourie
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.