mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Plex friends api
This commit is contained in:
parent
10b22cc7ab
commit
59d61b3a0f
6 changed files with 160 additions and 66 deletions
|
@ -1,6 +1,10 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using RequestPlex.Api.Models;
|
||||
using RestSharp;
|
||||
using RestSharp.Deserializers;
|
||||
using RestSharp.Serializers;
|
||||
|
||||
namespace RequestPlex.Api
|
||||
{
|
||||
|
@ -25,26 +29,30 @@ namespace RequestPlex.Api
|
|||
request.AddHeader("X-Plex-Product", "Request Plex");
|
||||
request.AddHeader("X-Plex-Version", "0.0.1");
|
||||
request.AddHeader("Content-Type", "application/json");
|
||||
|
||||
|
||||
request.AddJsonBody(userModel);
|
||||
|
||||
var api = new ApiRequest();
|
||||
return api.Execute<PlexAuthentication>(request, new Uri("https://plex.tv/users/sign_in.json"));
|
||||
}
|
||||
|
||||
public void GetUsers(string authToken)
|
||||
public PlexFriends GetUsers(string authToken)
|
||||
{
|
||||
var request = new RestRequest
|
||||
{
|
||||
Method = Method.POST,
|
||||
Method = Method.GET,
|
||||
};
|
||||
|
||||
request.AddHeader("X-Plex-Client-Identifier", "Test213");
|
||||
request.AddHeader("X-Plex-Product", "Request Plex");
|
||||
request.AddHeader("X-Plex-Version", "0.0.1");
|
||||
request.AddHeader("X-Plex-Token", authToken);
|
||||
request.AddHeader("Content-Type", "application/json");
|
||||
request.AddHeader("Content-Type", "application/xml");
|
||||
|
||||
var api = new ApiRequest();
|
||||
var users = api.Execute<PlexFriends>(request, new Uri("https://plex.tv/pms/friends/all"));
|
||||
|
||||
return users;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue