Garulf / Plexy

Search your Plex Library with Flow Launcher
Other
5 stars 0 forks source link

Stream does not launch on shown clients #4

Closed fuoar closed 2 years ago

fuoar commented 2 years ago

Behaviour

Selecting an item will indeed open it in the web browser and no errors are produced in log. However, opening the context menu on an item does not launch stream to the available Plex Clients shown.

Instead an error is thrown in the log file:

Full log file for event ``` 20:06:18 ERROR (launcher.py): Exception while calling method: play Traceback (most recent call last): File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\connection.py", line 174, in _new_conn conn = connection.create_connection( File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\util\connection.py", line 95, in create_connection raise err File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\util\connection.py", line 85, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it During handling of the above exception, another exception occurred: Traceback (most recent call last): File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\connection.py", line 239, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "\Python\Python310\lib\http\client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "\Python\Python310\lib\http\client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "\Python\Python310\lib\http\client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "\Python\Python310\lib\http\client.py", line 1037, in _send_output self.send(msg) File "\Python\Python310\lib\http\client.py", line 975, in send self.connect() File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\connection.py", line 205, in connect conn = self._new_conn() File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it During handling of the above exception, another exception occurred: Traceback (most recent call last): File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\requests\adapters.py", line 440, in send resp = conn.urlopen( File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\connectionpool.py", line 785, in urlopen retries = retries.increment( File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\urllib3\util\retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=32400): Max retries exceeded with url: /player/playback/playMedia?address=&commandID=1&containerKey=%2FplayQueues%2F1891%3Fwindow%3D100%26own%3D1&key=%2Flibrary%2Fmetadata%2F45258&machineIdentifier=a49621ffbf23de6700c4b714cda99150cfe00b57&offset=0&port=32400&token=transient-5fff16ec-e3fc-4d80-a19c-e1a96b93b32c&type=music (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\flox\launcher.py", line 41, in __call__ results = request_method(*request_parameters) File "\FlowLauncher\Plugins\Plexy-1.1.0\plugin\plexy.py", line 153, in play client.playMedia(_, **kwargs) File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\plexapi\client.py", line 513, in playMedia self.sendCommand('playback/playMedia', **dict({ File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\plexapi\client.py", line 231, in sendCommand return query(key, headers=headers) File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\plexapi\client.py", line 182, in query response = method(url, headers=headers, timeout=timeout, **kwargs) File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\requests\sessions.py", line 542, in get return self.request('GET', url, **kwargs) File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\requests\sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\requests\sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "\FlowLauncher\Plugins\Plexy-1.1.0\lib\requests\adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=32400): Max retries exceeded with url: /player/playback/playMedia?address=&commandID=1&containerKey=%2FplayQueues%2F1891%3Fwindow%3D100%26own%3D1&key=%2Flibrary%2Fmetadata%2F45258&machineIdentifier=a49621ffbf23de6700c4b714cda99150cfe00b57&offset=0&port=32400&token=transient-5fff16ec-e3fc-4d80-a19c-e1a96b93b32c&type=music (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')) ```

Not sure what to make of it and why there is a localhost in the log file host='127.0.0.1', port=32400?

Additionnaly, and maybe related, I can see only web plex clients (Web for Browser) and not other clients accessible from the browser.

Any help would be appreciated. Thanks

Garulf commented 2 years ago

Additionnaly, and maybe related, I can see only web plex clients (Web for Browser) and not other clients accessible from the browser.

This is because the web app also shows Chromecast/cast clients not just Plex Clients. Sadly this API is not exposed (as far as Im aware). I am however adding Chromecast support once internal testing is complete.

Not sure what to make of it and why there is a localhost in the log file host='127.0.0.1', port=32400?

That is odd it seems like the Plugin can't make a connection to the server.

Was this line edited by you? /player/playback/playMedia?address=<localserveraddress>

fuoar commented 2 years ago

Ok. Happy to read that.

Yes, I just replaced the local server address by <localserveraddress.

Garulf commented 2 years ago

Ok. Happy to read that.

Yes, I just replaced the local server address by <localserveraddress.

Okay just making sure. Is the plex client on the same machine as the client?

fuoar commented 2 years ago

Yes it is, that may explain the localhost.

Anyway, I just restarted the plex server, reset the plugin and it now works fine. I am not sure what made it, I should have tried that before opening an issue.

Thanks