mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
Fixed: Plex Meda Server authentication
This commit is contained in:
parent
f16f097b3e
commit
8773d38ddd
@ -120,8 +120,8 @@ public List<PlexPreference> Preferences(PlexServerSettings settings)
|
||||
|
||||
private string Authenticate(PlexServerSettings settings)
|
||||
{
|
||||
var request = GetMyPlexRequest("users/sign_in.json", Method.POST);
|
||||
var client = GetMyPlexClient(settings.Username, settings.Password);
|
||||
var request = GetPlexTvRequest("users/sign_in.json", Method.POST);
|
||||
var client = GetPlexTvClient(settings.Username, settings.Password);
|
||||
|
||||
var response = client.Execute(request);
|
||||
|
||||
@ -133,15 +133,15 @@ private string Authenticate(PlexServerSettings settings)
|
||||
return user.AuthenticationToken;
|
||||
}
|
||||
|
||||
private RestClient GetMyPlexClient(string username, string password)
|
||||
private RestClient GetPlexTvClient(string username, string password)
|
||||
{
|
||||
var client = RestClientFactory.BuildClient("https://my.plexapp.com");
|
||||
var client = RestClientFactory.BuildClient("https://plex.tv");
|
||||
client.Authenticator = new HttpBasicAuthenticator(username, password);
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
private RestRequest GetMyPlexRequest(string resource, Method method)
|
||||
private RestRequest GetPlexTvRequest(string resource, Method method)
|
||||
{
|
||||
var request = new RestRequest(resource, method);
|
||||
request.AddHeader("X-Plex-Platform", "Windows");
|
||||
|
Loading…
Reference in New Issue
Block a user