Hellowlol / bw_plex

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

Playstation client support #98

Closed SevereOverfl0w closed 5 years ago

SevereOverfl0w commented 5 years ago

When connecting with the PS4 client I got this log:

st_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:17:10,060 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 00:00 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:17:19,718 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 00:10 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:17:29,742 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 00:20 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:17:39,821 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 00:30 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:17:49,945 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 00:40 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:18:00,152 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 00:50 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:18:10,272 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 01:00 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:18:20,521 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 01:10 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:18:29,820 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 01:20 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:18:29,820 :: bw_plex :: DEBUG :: plex.py:1231 :: Brooklyn.Nine-Nine.s06e01 is in the correct time range theme_end
2019-07-18 13:18:29,821 :: bw_plex :: DEBUG :: plex.py:1187 :: Called jump with Brooklyn.Nine-Nine.s06e01 4 101.00680272108843 None
2019-07-18 13:18:29,826 :: bw_plex :: INFO :: plex.py:935 :: Called client_action with 101.00680272108843 01:41 4 None
2019-07-18 13:18:29,841 :: bw_plex :: INFO :: plex.py:968 :: sessionkey 4 media_sessionkey 4
2019-07-18 13:18:29,841 :: bw_plex :: INFO :: plex.py:972 :: client PlayStation 4 80.0
2019-07-18 13:18:29,841 :: bw_plex :: INFO :: plex.py:1004 :: Checking if we cant find the correct client
2019-07-18 13:18:29,841 :: bw_plex :: DEBUG :: plex.py:1015 :: We couldnt match the client. Trying a hail marry.
2019-07-18 13:18:29,842 :: bw_plex :: DEBUG :: plex.py:1026 :: Client hasnt a _baseurl enabling proxyThroughServer
2019-07-18 13:18:29,842 :: bw_plex :: DEBUG :: plex.py:1047 :: calculated_offset 101 0.101
2019-07-18 13:18:29,872 :: 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 1050, 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://plex:32400/player/playback/seekTo?commandID=1&offset=101000&type=video <?xml version='1.0' encoding='utf-8'?> <Response code="2000" status="FrameworkException: Unable to find player with identifier jbpenljgeb93v51qqzf8kkkw">   <Traceback>Traceback (most recent call last):   File "/usr/lib/plexmediaserver/Resources/Plug-ins-4b7ace214/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-4b7ace214/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 jbpenljgeb93v51qqzf8kkkw </Traceback> </Response> 
2019-07-18 13:18:39,997 :: bw_plex :: DEBUG :: plex.py:1200 :: Found Brooklyn.Nine-Nine.s06e01 theme start 01:23, theme end 01:41, ffmpeg_end 07:23 progress 01:30 best_time 01:41 credits_start 00:00 credits_end 00:00
2019-07-18 13:18:39,998 :: bw_plex :: DEBUG :: plex.py:1231 :: Brooklyn.Nine-Nine.s06e01 is in the correct time range theme_end

I'm not sure what this means exactly :)

Hellowlol commented 5 years ago

The client support is pretty limited to real clients. It does not work on ps4. Can you control the ps using your plex app on your phone? I’ll add a wiki with a list of the clients I have tested with later.

SevereOverfl0w commented 5 years ago

What is a "real client"? I've never tried with the app, I thought that was just for plex plus users, I'll have a look later.

Would it be possible to extend support? I'm proficient in python and could work on and test an implementation.

Hellowlol commented 5 years ago

A pr for this would be very nice! (Should be upstream in plexapi) a real app imo would be iOS android phone app, pmp, pht

There is also a option to create chapters. I think this could be a good option for clients we can’t control.