plex-mpv-shim icon indicating copy to clipboard operation
plex-mpv-shim copied to clipboard

Can't cast from certain servers

Open azizLIGHT opened this issue 3 years ago • 6 comments

When I cast media stored on a specific plex server and try to play something, Plex says "Playback Error. An error occurred trying to play this item." for all media on that server. I don't have this issue on other servers. The log looks like this:

2021-03-13 20:14:12,182 [    INFO] conf: Loaded settings from json: /home/aziz/.config/plex-mpv-shim/conf.json
2021-03-13 20:14:12,374 [    INFO] player: Using libmpv1 playback backend.
2021-03-13 20:14:12,381 [   ERROR] menu: Could not load profile manager.
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/menu.py", line 63, in __init__
    profile_manager = VideoProfileManager(self, playerManager)
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/video_profile.py", line 24, in __init__
    self.load_shader_pack()
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/video_profile.py", line 36, in load_shader_pack
    raise FileNotFoundError("Could not find default shader pack.")
FileNotFoundError: Could not find default shader pack.
2021-03-13 20:14:12,404 [    INFO] root: Started GDM service
2021-03-13 20:14:12,404 [    INFO] client: Started HTTP server
2021-03-13 20:14:12,420 [   DEBUG] PIL.PngImagePlugin: STREAM b'IHDR' 16 13
2021-03-13 20:14:12,421 [   DEBUG] PIL.PngImagePlugin: STREAM b'zTXt' 41 1315
2021-03-13 20:14:12,421 [   DEBUG] PIL.PngImagePlugin: STREAM b'bKGD' 1368 6
2021-03-13 20:14:12,421 [   DEBUG] PIL.PngImagePlugin: b'bKGD' 1368 6 (unknown)
2021-03-13 20:14:12,421 [   DEBUG] PIL.PngImagePlugin: STREAM b'pHYs' 1386 9
2021-03-13 20:14:12,421 [   DEBUG] PIL.PngImagePlugin: STREAM b'tIME' 1407 7
2021-03-13 20:14:12,421 [   DEBUG] PIL.PngImagePlugin: b'tIME' 1407 7 (unknown)
2021-03-13 20:14:12,421 [   DEBUG] PIL.PngImagePlugin: STREAM b'IDAT' 1426 612
2021-03-13 20:14:17,607 [   DEBUG] client: HttpHandler::handle_request request from 'fractal' to '/player/timeline/poll?commandID=0'
2021-03-13 20:14:17,607 [   DEBUG] subscribers: RemoteSubscriberManager::addSubscriber added  [asdfasdfasdfasdfasdfasdf]
2021-03-13 20:14:17,619 [   DEBUG] client: HttpHandler::handle_request request from 'fractal' to '/player/timeline/poll?commandID=0&wait=1'
2021-03-13 20:14:17,619 [   DEBUG] subscribers: RemoteSubscriberManager::addSubscriber refreshed asdfasdfasdfasdfasdfasdf
2021-03-13 20:14:17,619 [   DEBUG] subscribers: RemoteSubscriber::refresh asdfasdfasdfasdfasdfasdf (cid=0)
2021-03-13 20:14:30,479 [   DEBUG] client: HttpHandler::handle_request request from 'fractal' to '/player/playback/playMedia?providerIdentifier=com.plexapp.plugins.library&protocol=http&containerKey=%2FplayQueues%2F80%3Fown%3D1&address=1.1.1.1&port=42452&token=REDACTED&key=%2Flibrary%2Fmetadata%2F528537&offset=0&machineIdentifier=asdfasdfasdfasdfasdfasdf&type=video&commandID=1'
----------------------------------------
Exception occurred during processing of request from ('10.0.0.100', 57978)
Traceback (most recent call last):
  File "/usr/lib/python3.9/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.9/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.9/http/server.py", line 653, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/lib/python3.9/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/lib/python3.9/http/server.py", line 427, in handle
    self.handle_one_request()
  File "/usr/lib/python3.9/http/server.py", line 415, in handle_one_request
    method()
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/client.py", line 197, in do_GET
    self.handle_request("GET")
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/client.py", line 175, in handle_request
    getattr(self, handler)(path, query)
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/client.py", line 309, in playMedia
    media = Media(url, play_queue=playQueue)
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/media.py", line 466, in __init__
    XMLCollection.__init__(self, url)
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/media.py", line 448, in __init__
    self.tree       = et.parse(urllib.request.urlopen(get_plex_url(url)))
  File "/usr/lib/python3.9/site-packages/plex_mpv_shim/utils.py", line 81, in get_plex_url
    raise ValueError("HTTP is not enabled in the configuration.")
ValueError: HTTP is not enabled in the configuration.
----------------------------------------
2021-03-13 20:14:32,867 [   DEBUG] client: HttpHandler::handle_request request from 'fractal' to '/player/playback/stop?commandID=2'
2021-03-13 20:14:32,867 [   DEBUG] timeline: TimelineManager::SendTimelineToSubscribers updating all subscribers
2021-03-13 20:14:32,880 [   DEBUG] client: HttpHandler::handle_request request from 'fractal' to '/player/timeline/poll?commandID=2&wait=1'
2021-03-13 20:14:32,880 [   DEBUG] subscribers: RemoteSubscriberManager::addSubscriber refreshed asdfasdfasdfasdfasdfasdf
2021-03-13 20:14:32,880 [   DEBUG] subscribers: RemoteSubscriber::refresh asdfasdfasdfasdfasdfasdf (cid=2)
^C2021-03-13 20:14:35,832 [    INFO] gui_mgr: Stopping due to CTRL+C.
2021-03-13 20:14:35,832 [    INFO] client: Stopping HTTP server...

azizLIGHT avatar Mar 14 '21 01:03 azizLIGHT

That would be because those servers probably aren't signed in so they aren't using HTTPS. You can enable insecure connections in the config by setting allow_http to true.

iwalton3 avatar Mar 14 '21 01:03 iwalton3

Where exactly do you mean that they aren't signed in? How do I provide the authentication or credentials so that they are signed in, and so that I can cast from this server? I would rather not set allow_http true unless necessary

azizLIGHT avatar Mar 17 '21 05:03 azizLIGHT

If you are not signed into the Plex server or disabled authentication then it’ll try to use HTTP to cast to your server insecurely.

iwalton3 avatar Mar 17 '21 11:03 iwalton3

I'm signed into all my Plex servers in my Plex client already. Is there something separate I need to do for plex-mpv-shim to have it signed into my servers as well? Where do I accomplish this?

azizLIGHT avatar Mar 18 '21 15:03 azizLIGHT

The logs posted show that the play request is trying to connect insecurely to a Plex server. Either auth is disabled on local networks or the server is not signed in. The solution is to either enable http connections or ensure the Plex server is used securely.

iwalton3 avatar Mar 18 '21 16:03 iwalton3

I had this issue too for a long time, couldn't get it working with any computers in my house. Turns out, Remote Access needs to be enabled in the server's config. I had been using a reverse proxy to access Plex, which was working just fine for everything else.

BradleyShaner avatar May 25 '21 23:05 BradleyShaner