Hellowlol / bw_plex

binge watching for plex
MIT License
368 stars 23 forks source link

Android playback breaks #103

Closed nelsonblaha closed 4 years ago

nelsonblaha commented 4 years ago
2019-09-18 02:18:02,798 :: bw_plex :: DEBUG :: plex.py:1184 :: Called jump with Orange.Is.the.New.Black.s07e01 213 71.84253968253968 None
2019-09-18 02:18:02,799 :: bw_plex :: INFO :: plex.py:932 :: Called client_action with 71.84253968253968 01:11 213 None
2019-09-18 02:18:02,849 :: bw_plex :: INFO :: plex.py:965 :: sessionkey 213 media_sessionkey 187
2019-09-18 02:18:02,849 :: bw_plex :: INFO :: plex.py:965 :: sessionkey 213 media_sessionkey 213
2019-09-18 02:18:02,850 :: bw_plex :: INFO :: plex.py:969 :: client OnePlus 6 9.729
2019-09-18 02:18:02,851 :: bw_plex :: INFO :: plex.py:1001 :: Checking if we cant find the correct client
2019-09-18 02:18:02,851 :: bw_plex :: INFO :: plex.py:1003 :: 5s4pnb527pihqoa89ds4qi91 fc549eec84edb2ba-com-plexapp-android
2019-09-18 02:18:02,851 :: bw_plex :: DEBUG :: plex.py:1012 :: We couldnt match the client. Trying a hail marry.
2019-09-18 02:18:02,852 :: bw_plex :: DEBUG :: plex.py:1023 :: Client hasnt a _baseurl enabling proxyThroughServer
2019-09-18 02:18:02,852 :: bw_plex :: DEBUG :: plex.py:1044 :: calculated_offset 71 0.071
2019-09-18 02:18:02,867 :: bw_plex :: ERROR :: plex.py:85 :: There was an exception in client_action
Traceback (most recent call last):
  File "/app/bw_plex/bw_plex/plex.py", line 80, in inner
    return func(*args)
  File "/app/bw_plex/bw_plex/plex.py", line 1047, in client_action
    proxy_on_fail(correct_client.seekTo(calculated_offset * 1000))
  File "/usr/local/lib/python3.6/dist-packages/plexapi/client.py", line 325, in seekTo
    self.sendCommand('playback/seekTo', offset=offset, type=mtype)
  File "/usr/local/lib/python3.6/dist-packages/plexapi/client.py", line 193, in sendCommand
    return self._server.query(key, headers=headers)
  File "/usr/local/lib/python3.6/dist-packages/plexapi/server.py", line 348, in query
    raise BadRequest('(%s) %s; %s %s' % (response.status_code, codename, response.url, errtext))
plexapi.exceptions.BadRequest: (500) internal_server_error; http://192.168.86.26:32400/player/playback/seekTo?commandID=1&offset=71000&type=video <?xml version='1.0' encoding='utf-8'?> <Response code="2000" status="FrameworkException: Unable to find player with identifier fc549eec84edb2ba-com-plexapp-android">   <Traceback>Traceback (most recent call last):   File "/usr/lib/plexmediaserver/Resources/Plug-ins-b9d49bdb7/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 843, in handle_request     result = f(**d)   File "/usr/lib/plexmediaserver/Resources/Plug-ins-b9d49bdb7/System.bundle/Contents/Code/playerservice.py", line 50, in process_remote_command     raise FrameworkException('Unable to find player with identifier %s' % identifier) FrameworkException: Unable to find player with identifier fc549eec84edb2ba-com-plexapp-android </Traceback> </Response> 
Hellowlol commented 4 years ago

I don’t think this just a android issue. I sometime get this on iOS to.

What happens here is we query the servers /client endpoint to get a list of client connected to the local network. (As the websocket tick don’t contain a url we can use. If that fails for some reason (not listed in the /clients) we try to send the command to the server and the server fails to find the correct client to proxy the request to. I don’t know any better ways to solve this.

If anybody has some ideas on how to handle this that would be awesome

Hellowlol commented 4 years ago

Closing this as there is nothing I can do as long as the client isn’t on the same network. (According to pms)