Hellowlol / bw_plex

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

Doesn't work with Plex for Kodi #111

Open deepfriedmind opened 4 years ago

deepfriedmind commented 4 years ago

It's working fine for me in the Plex Android app but when using Plex for Kodi I get the following error:


2019-12-20 18:12:35,425 :: bw_plex :: DEBUG :: plex.py:1188 :: Found Futurama.s06e02 theme start 00:06, theme end 00:13, ffmpeg_end 07:00 progress 00:02 fake_progress 00:12 best_time 00:13 credits_start 00:00 credits_end 00:00
2019-12-20 18:12:35,426 :: bw_plex :: DEBUG :: plex.py:1229 :: Futurama.s06e02 is in the correct time range theme_end
2019-12-20 18:12:35,426 :: bw_plex :: DEBUG :: plex.py:1157 :: Called jump with Futurama.s06e02 42 13.862312925170068 None
2019-12-20 18:12:35,428 :: bw_plex :: INFO :: plex.py:931 :: Called client_action with 13.862312925170068 00:13 42 None
2019-12-20 18:12:35,529 :: bw_plex :: INFO :: plex.py:964 :: sessionkey 42 media_sessionkey 42
2019-12-20 18:12:35,530 :: bw_plex :: INFO :: plex.py:968 :: client Kodi Add-on (localhost) 2.911
2019-12-20 18:12:35,530 :: bw_plex :: INFO :: plex.py:995 :: Checking if we cant find the correct client
2019-12-20 18:12:35,531 :: bw_plex :: INFO :: plex.py:997 :: 82d73289ca7e5af2-com-plexapp-android 8c423f5e-2a31-47bb-8f41-5d1048b03878
2019-12-20 18:12:35,531 :: bw_plex :: INFO :: plex.py:997 :: c0bf744e04b03449-com-plexapp-android 8c423f5e-2a31-47bb-8f41-5d1048b03878
2019-12-20 18:12:35,531 :: bw_plex :: INFO :: plex.py:997 :: o15p7jep2xrhnryqzmnl7iom 8c423f5e-2a31-47bb-8f41-5d1048b03878
2019-12-20 18:12:35,532 :: bw_plex :: DEBUG :: plex.py:1006 :: We couldnt match the client. Trying a hail marry.
2019-12-20 18:12:35,532 :: bw_plex :: DEBUG :: plex.py:1019 :: Client hasnt a _baseurl or is a browser, enabling proxyThroughServer
2019-12-20 18:12:35,533 :: bw_plex :: DEBUG :: plex.py:1040 :: calculated_offset 13 0.013
2019-12-20 18:12:35,619 :: bw_plex :: ERROR :: plex.py:89 :: There was an exception in client_action
Traceback (most recent call last):
  File "/app/bw_plex/bw_plex/plex.py", line 84, in inner
    return func(*args)
  File "/app/bw_plex/bw_plex/plex.py", line 1043, in client_action
    proxy_on_fail(correct_client.seekTo(calculated_offset * 1000))
  File "/usr/local/lib/python3.6/dist-packages/plexapi/client.py", line 344, in seekTo
    self.sendCommand('playback/seekTo', offset=offset, type=mtype)
  File "/usr/local/lib/python3.6/dist-packages/plexapi/client.py", line 204, in sendCommand
    return query(key, headers=headers)
  File "/usr/local/lib/python3.6/dist-packages/plexapi/server.py", line 381, in query
    raise BadRequest('(%s) %s; %s %s' % (response.status_code, codename, response.url, errtext))
plexapi.exceptions.BadRequest: (500) internal_server_error; http://10.0.1.13:32400/player/playback/seekTo?commandID=1&offset=13000&type=video <?xml version='1.0' encoding='utf-8'?> <Response code="2000" status="FrameworkException: Unable to find player with identifier 8c423f5e-2a31-47bb-8f41-5d1048b03878">   <Traceback>Traceback (most recent call last):   File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-349e9837e/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 843, in handle_request     result = f(**d)   File "/volume1/@appstore/Plex Media Server/Resources/Plug-ins-349e9837e/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 8c423f5e-2a31-47bb-8f41-5d1048b03878 </Traceback> </Response>```
Hellowlol commented 4 years ago

Thanks for the report! I dont think plexapi works with this client. Its easy to test if you do Plexserver().clients() the client needs to be listed there for it to work. In this case, we dont have url for the kodi addon client and (_baseurl in the errors msg) so we try to relay the command to the server but even that fails.

pannal commented 4 months ago

A little late to the party here, but PM4K has a binge mode for TV shows: https://forums.plex.tv/t/pm4k-plexmod-for-kodi-18-19-20-21/481208