Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get server due to plex security setting #106

Open
CED0001 opened this issue Oct 28, 2023 · 1 comment
Open

Unable to get server due to plex security setting #106

CED0001 opened this issue Oct 28, 2023 · 1 comment

Comments

@CED0001
Copy link

CED0001 commented Oct 28, 2023

Describe the bug
When running the AccountServerContainer.Servers() method, my server only gets returned if the plex > settings > network > secure connections setting is set to "preferred" in stead of "required"

To Reproduce
Steps to reproduce the behavior:

  1. Go to plex > settings > network > secure connections
    image
    And set the secure connection to required:
    image

  2. In your code, run this:

var account = plexFactory.GetPlexAccount(plexToken);

var serversSumm = await account.ServerSummaries(); //always returns 1 server (which is as expected ✅)
var servers = await account.Servers(); //returns 0 servers when secure connection is required, returns 1 server when "preferred"

Expected behavior
account.Servers() to always return the same amount of servers as ServerSummaries()

Screenshots
image

Additional context
interestingly, within the serverSumm variable that is shown above, there is a property named "Scheme". When inspecting this, I can see that it was set to http, instead of the expected "https" (since the servers security setting is set to require secure connections)
Maybe this plays a role in this story as well.

image

@CED0001
Copy link
Author

CED0001 commented Nov 1, 2023

Looks like this issue stems from the following http call: [GET] https://plex.tv/pms/servers.xml (with plex token in the header).
This gets called in PlexAccountClient.GetAccountServersAsync(). Plex then returns http scheme which won't work for future calls like the one used in Servers() method.

I have yet to find the Plex setting that edits this. (If it even exists)

I'm considering adding some sort of override to this method (GetAccountServersAsync()), so that the scheme is set manually, and the Servers() method doesn't crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant