-
Notifications
You must be signed in to change notification settings - Fork 200
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 connect to a Plex HTPC client #1292
Comments
Try using >>> import plexapi
>>> from plexapi.server import PlexServer
>>> baseurl = 'http://SERVERIP:32400'
>>> plex = PlexServer(baseurl)
>>> client = plex.client("HTPC")
>>> client.proxyThroughServer()
>>> client.timeline |
Thank you, using the client.proxyThroughServer() does help and it's able to show the timeline.
|
Just to add that when adding the mtype='music' to the command ( as the playing media was music ), the playback does actually pause, but the command still hangs and excepts with the same exception :
|
I also have issues with retrieving client.isPlayingMedia() status ( and also timeline ) for the HTPC client when the client is freshly restarted and the media playback is initiated from the client itself, not via Plex companion / API . Once there is connection to the client via Plex companion ( for instance Plex for MacOS,from the cast icon selecting the HTPC client ) even while that media is still being played at the HTPC client, once it connects, the API starts to recognising the client that it plays the media. Once I disconnected from HTPC in the Plex for Mac app, the API still recognizing the client playing media, but once the playback is stopped and timeline cleared. The next media playback won't be recognised by the API until I connect via a Plex app to control HTPC. |
Describe the Bug
When connecting to a HTPC (windows,1.50.1.4014) client, the API cannot connect properly as it retrieves its IP as 127.0.0.1 instead of its real IP. Other clients like Plexamp or Plex for mac work fine.
Code Snippets
Expected Behavior
To be able to connect to HTPC client and control it
Additional Context
Retrieving the clients from the server via SERVERIP:32400/clients shows the HTPC twice, once with 127.0.0.1 and also one with IP of the server ( rather than the IP of the actual client ).
If I iterate over the plex.clients() and use the instance with the server's IP address, I'm able to retrieve the timeline but can't control the client like client.pause() and get timeout error :
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='SERVERIP', port=32400): Read timed out. (read timeout=30)
Operating System and Version
Debian ( PlexAPI ) , Ubuntu ( Plex Server ) , Windows 11 ( Plex HTPC )
Plex Media Server Version
1.32.7.7621
Python Version
3.9.2
PlexAPI Version
4.15.5
The text was updated successfully, but these errors were encountered: