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

Connect() Failing, Manual Chrome Access Works #1145

Open
arrmo opened this issue Apr 16, 2023 · 2 comments
Open

Connect() Failing, Manual Chrome Access Works #1145

arrmo opened this issue Apr 16, 2023 · 2 comments

Comments

@arrmo
Copy link

arrmo commented Apr 16, 2023

Describe the Bug

Hi,

This may be me, but 😆. I am connecting to my Plex server - actually, trying to open a connection to each one (for monitoring), but even just one - it's failing. Some of the connections will (not sure why every IP is showing up!), but I have manually gone to Chrome, and I can connect. Code shown below.

Thanks!

Code Snippets

try:
    logging.info('Connecting to Plex Account ...')
    account = MyPlexAccount('email', 'password')
    logging.info('Connected. Now enumerating servers (automatically)')
    for resource in account.resources():
        server: PlexServer = resource.connect(timeout=1)

Expected Behavior

I would expect this to connect. If I use account.resources()[1], and concatenate uri and ?X-Plex-Token=XXXXX ... it works fine (from Chrome). But, it fails from the code above. It seems like it is only trying the first connection on this list. I say that because ... there are 6 connections => [0] fails (as it should), but [1] should work. But, I get an exception after 1 second, so it's only trying the first connection.

Additional Context

No response

Operating System and Version

Ubuntu, 22.04

Plex Media Server Version

1.32.0.6918

Python Version

3.9.12

PlexAPI Version

4.13.4

@jjlawren
Copy link
Collaborator

Wrap the try: only around the resource.connect() call so that the loop can continue.

@arrmo
Copy link
Author

arrmo commented Apr 16, 2023

Actually, fiddling in parallel ... it seems to work if I set the server to Secure connections Required, but fails if Preferred. Make sense?

Thanks!

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

2 participants