Hellowlol / bw_plex

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

Does not work with Plex for Windows app #153

Open HaxXorHardy opened 2 years ago

HaxXorHardy commented 2 years ago

get this error

`Called jump with The Familiar of Zero - s01e06 - A Thief's Identity 150 131.37850340136055 None 2022-05-20 14:51:59,279 :: bw_plex :: INFO :: plex.py:931 :: Called client_action with 131.37850340136055 02:11 150 None 2022-05-20 14:51:59,294 :: bw_plex :: INFO :: plex.py:967 :: sessionkey 150 media_sessionkey 150 2022-05-20 14:51:59,295 :: bw_plex :: INFO :: plex.py:971 :: client DESKTOP-6MO0765 58.0 2022-05-20 14:51:59,295 :: bw_plex :: INFO :: plex.py:998 :: Checking if we cant find the correct client 2022-05-20 14:51:59,302 :: bw_plex :: INFO :: plex.py:1000 :: gmi459vgr4d8aauk7byp6eev gmi459vgr4d8aauk7byp6eev 2022-05-20 14:51:59,302 :: bw_plex :: INFO :: plex.py:1017 :: Connectiong to DESKTOP-6MO0765 2022-05-20 14:52:09,262 :: bw_plex :: DEBUG :: plex.py:1191 :: Found The Familiar of Zero - s01e06 - A Thief's Identity theme start 01:04, theme end 02:11, ffmpeg_end 00:00 progress 01:08 fake_progress 01:18 best_time 02:11 credits_start 21:40 credits_end 23:39 2022-05-20 14:52:09,262 :: bw_plex :: DEBUG :: plex.py:1232 :: The Familiar of Zero - s01e06 - A Thief's Identity is in the correct time range theme_end 2022-05-20 14:52:19,276 :: bw_plex :: DEBUG :: plex.py:1191 :: Found The Familiar of Zero - s01e06 - A Thief's Identity theme start 01:04, theme end 02:11, ffmpeg_end 00:00 progress 01:18 fake_progress 01:28 best_time 02:11 credits_start 21:40 credits_end 23:39 2022-05-20 14:52:19,276 :: bw_plex :: DEBUG :: plex.py:1232 :: The Familiar of Zero - s01e06 - A Thief's Identity is in the correct time range theme_end 2022-05-20 14:52:29,261 :: bw_plex :: DEBUG :: plex.py:1191 :: Found The Familiar of Zero - s01e06 - A Thief's Identity theme start 01:04, theme end 02:11, ffmpeg_end 00:00 progress 01:28 fake_progress 01:38 best_time 02:11 credits_start 21:40 credits_end 23:39 2022-05-20 14:52:29,262 :: bw_plex :: DEBUG :: plex.py:1232 :: The Familiar of Zero - s01e06 - A Thief's Identity is in the correct time range theme_end 2022-05-20 14:52:29,331 :: bw_plex :: ERROR :: plex.py:1029 :: Cant connect to DESKTOP-6MO0765 Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 170, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 96, in create_connection raise err File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa) socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 706, in urlopen chunked=chunked, File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 394, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 234, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/lib/python3.7/http/client.py", line 1260, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1030, in _send_output self.send(msg) File "/usr/lib/python3.7/http/client.py", line 970, in send self.connect() File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 200, in connect conn = self._new_conn() File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 177, in _new_conn % (self.host, self.timeout), urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7fa793f30550>, 'Connection to 192.168.1.16 timed out. (connect timeout=30)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 756, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py", line 573, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.1.16', port=32400): Max retries exceeded with url: /resources (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fa793f30550>, 'Connection to 192.168.1.16 timed out. (connect timeout=30)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/hardy/src/bw-plex/bw_plex/plex.py", line 1018, in client_action correct_client.connect() File "/home/hardy/.local/lib/python3.7/site-packages/plexapi/client.py", line 95, in connect data = self.query(self.key, timeout=timeout) File "/home/hardy/.local/lib/python3.7/site-packages/plexapi/client.py", line 182, in query response = method(url, headers=headers, timeout=timeout, kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 555, in get return self.request('GET', url, kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 655, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 504, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='192.168.1.16', port=32400): Max retries exceeded with url: /resources (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fa793f30550>, 'Connection to 192.168.1.16 timed out. (connect timeout=30)')) 2022-05-20 14:52:29,358 :: bw_plex :: DEBUG :: plex.py:1043 :: calculated_offset 161 0.161 2022-05-20 14:52:36,118 :: bw_plex :: DEBUG :: credits.py:505 :: credits_start 1317.983, credits_end 1420.961 2022-05-20 14:52:36,121 :: bw_plex :: DEBUG :: plex.py:221 :: Added The Familiar of Zero - s01e08 - Tabitha's Secret to media.db 2022-05-20 14:52:59,391 :: bw_plex :: INFO :: plex.py:946 :: Failed to reach the client directly, trying via server. 2022-05-20 14:52:59,392 :: bw_plex :: ERROR :: plex.py:89 :: There was an exception in client_action Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 170, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 96, in create_connection raise err File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa) socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 706, in urlopen chunked=chunked, File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 394, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 234, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/lib/python3.7/http/client.py", line 1260, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1030, in _send_output self.send(msg) File "/usr/lib/python3.7/http/client.py", line 970, in send self.connect() File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 200, in connect conn = self._new_conn() File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 177, in _new_conn % (self.host, self.timeout), urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7fa793f35080>, 'Connection to 192.168.1.16 timed out. (connect timeout=30)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 756, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py", line 573, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.1.16', port=32400): Max retries exceeded with url: /player/playback/seekTo?commandID=1&offset=161000&type=video (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fa793f35080>, 'Connection to 192.168.1.16 timed out. (connect timeout=30)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/hardy/src/bw-plex/bw_plex/plex.py", line 940, in inner return func(*args) File "/home/hardy/.local/lib/python3.7/site-packages/plexapi/client.py", line 376, in seekTo self.sendCommand('playback/seekTo', offset=offset, type=mtype) File "/home/hardy/.local/lib/python3.7/site-packages/plexapi/client.py", line 231, in sendCommand return query(key, headers=headers) File "/home/hardy/.local/lib/python3.7/site-packages/plexapi/client.py", line 182, in query response = method(url, headers=headers, timeout=timeout, kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 555, in get return self.request('GET', url, kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 655, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 504, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='192.168.1.16', port=32400): Max retries exceeded with url: /player/playback/seekTo?commandID=1&offset=161000&type=video (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fa793f35080>, 'Connection to 192.168.1.16 timed out. (connect timeout=30)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/hardy/src/bw-plex/bw_plex/plex.py", line 84, in inner return func(args) File "/home/hardy/src/bw-plex/bw_plex/plex.py", line 1046, in client_action proxy_on_fail(correct_client.seekTo)(calculated_offset 1000) File "/home/hardy/src/bw-plex/bw_plex/plex.py", line 948, in inner return func() TypeError: seekTo() missing 1 required positional argument: 'offset'`

Fonzzz commented 1 year ago

Can't get it to work either! Log:

2022-08-09 17:13:10,041 :: bw_plex :: INFO :: init.py:168 :: Using bw_plex version 0.1.1.dev95+g86768d6 2022-08-09 17:13:10,041 :: bw_plex :: INFO :: init.py:169 :: default folder set to C:\Users\RandomUser/.config/bw_plex 2022-08-09 17:13:10,295 :: bw_plex :: DEBUG :: misc.py:64 :: Getting server RandomServer 2022-08-09 17:13:32,230 :: bw_plex :: INFO :: init.py:168 :: Using bw_plex version 0.1.1.dev95+g86768d6 2022-08-09 17:13:32,230 :: bw_plex :: INFO :: init.py:169 :: default folder set to C:\Users\RandomUser/.config/bw_plex 2022-08-09 17:13:32,479 :: bw_plex :: DEBUG :: misc.py:64 :: Getting server RandomServer 2022-08-09 17:14:00,055 :: bw_plex :: INFO :: init.py:168 :: Using bw_plex version 0.1.1.dev95+g86768d6 2022-08-09 17:14:00,056 :: bw_plex :: INFO :: init.py:169 :: default folder set to C:\Users\RandomUser/.config/bw_plex 2022-08-09 17:14:00,307 :: bw_plex :: DEBUG :: misc.py:64 :: Getting server RandomServer 2022-08-09 17:14:06,265 :: bw_plex :: INFO :: init.py:168 :: Using bw_plex version 0.1.1.dev95+g86768d6 2022-08-09 17:14:06,266 :: bw_plex :: INFO :: init.py:169 :: default folder set to C:\Users\RandomUser/.config/bw_plex 2022-08-09 17:14:06,518 :: bw_plex :: DEBUG :: misc.py:64 :: Getting server RandomServer 2022-08-09 17:14:37,271 :: bw_plex :: INFO :: init.py:168 :: Using bw_plex version 0.1.1.dev95+g86768d6 2022-08-09 17:14:37,272 :: bw_plex :: INFO :: init.py:169 :: default folder set to C:\Users\RandomUser/.config/bw_plex 2022-08-09 17:14:37,520 :: bw_plex :: DEBUG :: misc.py:64 :: Getting server RandomServer 2022-08-09 17:14:37,521 :: bw_plex :: DEBUG :: misc.py:572 :: Getting hashtable 2022-08-09 17:14:37,609 :: bw_plex :: INFO :: misc.py:658 :: Loading existing files in db 2022-08-09 17:14:38,929 :: bw_plex :: DEBUG :: misc.py:587 :: Files in the hashtable 2022-08-09 17:14:38,934 :: bw_plex :: DEBUG :: plex.py:1318 :: ws event Ready(response=<response HTTP/1.1 101 Switching Protocols>, protocol=None, extensions=set()) 2022-08-09 17:14:51,141 :: bw_plex :: DEBUG :: plex.py:1238 :: Failed to find ratingkey 25027 in the db 2022-08-09 17:14:51,153 :: bw_plex :: DEBUG :: plex.py:1098 :: Found RandomAnime - s02e02 - 2022-08-09 17:14:51,154 :: bw_plex :: DEBUG :: plex.py:1103 :: Download the first 10 minutes of RandomAnime - s02e02 - .wav 2022-08-09 17:14:51,154 :: bw_plex :: DEBUG :: plex.py:886 :: Checking if we can reach RandomAnime - s02e02 - directly 2022-08-09 17:14:51,155 :: bw_plex :: DEBUG :: plex.py:896 :: Found D:\Seriespath\Anime\RandomAnime\Season 2 (2022 Winter)\ RandomAnime S02E02 [1080p].mkv directly 2022-08-09 17:14:51,156 :: bw_plex :: DEBUG :: audio.py:45 :: calling ffmpeg with ffmpeg -i "D:\Seriespath\Anime\RandomAnime\Season 2 (2022 Winter)\ RandomAnime S02E02 [1080p].mkv" -ac 1 -ar 11025 -ss 0 -t 600 -acodec pcm_s16le C:\Users\RandomUser\AppData\Local\Temp\offset_8ifo2cfk.wav 2022-08-09 17:14:51,165 :: bw_plex :: ERROR :: plex.py:89 :: There was an exception in task

Traceback (most recent call last): File "c:\users\RandomUser\src\bw-plex\bw_plex\plex.py", line 84, in inner return func(*args) File "c:\users\RandomUser\src\bw-plex\bw_plex\plex.py", line 1104, in task vid = convert_and_trim(check_file_access(media), fs=11025, File "c:\users\RandomUser\src\bw-plex\bw_plex\audio.py", line 50, in convert_and_trim psox = subprocess.Popen(cmd, stderr=subprocess.PIPE) File "C:\Users\RandomUser\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\RandomUser\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

Hellowlol commented 1 year ago

You need to install ffmpeg.

HaxXorHardy commented 1 year ago

i retried today and installed via docker compose. now i get this error.



2023-05-01 00:27:13,142 :: bw_plex :: DEBUG :: plex.py:1232 :: In.Another.World.With.My.Smartphone.s01e01 is in the correct time range theme_end

2023-05-01 00:27:13,142 :: bw_plex :: DEBUG :: plex.py:1160 :: Called jump with In.Another.World.With.My.Smartphone.s01e01 2 183.2286621315193 None

2023-05-01 00:27:13,142 :: bw_plex :: INFO :: plex.py:931 :: Called client_action with 183.2286621315193 03:03 2 None

2023-05-01 00:27:13,146 :: bw_plex :: INFO :: plex.py:967 :: sessionkey 2 media_sessionkey 2

2023-05-01 00:27:13,146 :: bw_plex :: INFO :: plex.py:971 :: client Revision-PC 155.0

2023-05-01 00:27:13,146 :: bw_plex :: INFO :: plex.py:998 :: Checking if we cant find the correct client

2023-05-01 00:27:13,146 :: bw_plex :: DEBUG :: plex.py:1009 :: We couldnt match the client. Trying a hail marry.

2023-05-01 00:27:13,146 :: bw_plex :: DEBUG :: plex.py:1022 :: Client hasnt a _baseurl or is a browser, enabling proxyThroughServer

2023-05-01 00:27:13,146 :: bw_plex :: DEBUG :: plex.py:1043 :: calculated_offset 183 0.183

2023-05-01 00:27:13,148 :: bw_plex :: ERROR :: plex.py:89 :: There was an exception in client_action

Traceback (most recent call last):

  File "/app/bw_plex/lib/python3.6/site-packages/bw_plex/plex.py", line 84, in inner

    return func(*args)

  File "/app/bw_plex/lib/python3.6/site-packages/bw_plex/plex.py", line 1046, in client_action

    proxy_on_fail(correct_client.seekTo)(calculated_offset * 1000)

  File "/app/bw_plex/lib/python3.6/site-packages/bw_plex/plex.py", line 940, in inner

    return func(*args)

  File "/app/bw_plex/lib/python3.6/site-packages/plexapi/client.py", line 352, in seekTo

    self.sendCommand('playback/seekTo', offset=offset, type=mtype)

  File "/app/bw_plex/lib/python3.6/site-packages/plexapi/client.py", line 207, in sendCommand

    return query(key, headers=headers)

  File "/app/bw_plex/lib/python3.6/site-packages/plexapi/server.py", line 434, in query

    raise NotFound(message)

plexapi.exceptions.NotFound: (404) not_found; http://192.168.1.22:32400/player/playback/seekTo?commandID=1&offset=183000&type=video <html><head><title>Not Found</title></head><body><h1>404 Not Found</h1></body></html>

2023-05-01 00:27:23,143 :: bw_plex :: DEBUG :: plex.py:1191 :: Found In.Another.World.With.My.Smartphone.s01e01 theme start 02:36, theme end 03:03, ffmpeg_end 00:00 progress 02:45 fake_progress 02:55 best_time 03:03 credits_start 00:00 credits_end 00:00

2023-05-01 00:27:23,143 :: bw_plex :: DEBUG :: plex.py:1232 :: In.Another.World.With.My.Smartphone.s01e01 is in the correct time range theme_end```