Closed Antho91 closed 4 years ago
The same happens on Mac.
mm strange that it works on android devices.
Quick question. Do I need to edit the "config.ini" file?
My setup. I'm using a docker container. In my docker-compose file I have the following:
version: '3'
services:
plex:
image: plexinc/pms-docker:latest
container_name: plex
restart: always
network_mode: host
volumes:
- ./config:/config
- ./transcode:/transcode
- ./downloads:/data
environment:
- TZ=EUROPE/AMSTERDAM
- PLEX_CLAIM=claim-XXXXXXXXXXXXX
- PLEX_UID=1000
- PLEX_GID=1000
- ADVERTISE_IP="http://XXX.XXX.XXX.XX:32400/"
bw_plex:
image: hellowlol/bw_plex:latest
container_name: bw_plex
restart: unless-stopped
network_mode: bridge
volumes:
- /etc/localtime:/etc/localtime:ro
- ./config:/config
# Replace with your Plex media path
- ./downloads:/data
environment:
- url=http://XXX.XXX.XXX.XX:32400/
- token:XXXXX
- TZ=EUROPE/AMSTERDAM
command: bash -c "bw_plex --url http://XXX.XXX.XXX.XX:32400/ -t XXXXXXXXXX -df /config watch"
Seems like it failed to connect to chrome. Is this host='192.168.178.35', port=32400 the server or chrome?
You dont need to edit the config unless you want to add/remove extra settings.
host='192.168.178.35', port=32400
This is the IP of the computer where I'm watching a serie.
So no it's not the server.
It's not only Chrome, I've also tested it on Edge and Safari and they all have the same behaviour if I navigate to plex.tv or 192.168.178.21:32400 (which is the server with the docker container).
Thanks. What happens here is that we cant reach the client. The exception is swallowed and logged as some clients dont like the /resource. What the command is sent regarding seekto we get invalid xml response it blows up as proxy_is_fail checks for http errors and not the response. Can you run the command manually and see what the response actually is?
I've runned in the docker container the following command
bw_plex --url http://192.168.178.21:32400/ -t XXXXXXXXXXXXX -df /config watch
And I've recieved the following output:
2019-12-12 11:48:14,610 :: bw_plex :: DEBUG :: plex.py:1227 :: Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e11 is in the correct time range theme_end
2019-12-12 11:48:14,610 :: bw_plex :: DEBUG :: plex.py:1155 :: Called jump with Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e11 6 208.77061224489796 None
2019-12-12 11:48:14,616 :: bw_plex :: INFO :: plex.py:931 :: Called client_action with 208.77061224489796 03:28 6 None
2019-12-12 11:48:14,645 :: bw_plex :: INFO :: plex.py:964 :: sessionkey 6 media_sessionkey 6
2019-12-12 11:48:14,646 :: bw_plex :: INFO :: plex.py:968 :: client Chrome 88.0
2019-12-12 11:48:14,646 :: bw_plex :: INFO :: plex.py:995 :: Checking if we cant find the correct client
2019-12-12 11:48:14,646 :: bw_plex :: INFO :: plex.py:997 :: guds4bnn1xffqkc758pplsab guds4bnn1xffqkc758pplsab
2019-12-12 11:48:14,647 :: bw_plex :: INFO :: plex.py:1012 :: Connectiong to Chrome
2019-12-12 11:48:35,412 :: bw_plex :: DEBUG :: plex.py:1186 :: Found Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e11 theme start 01:32, theme end 03:28, ffmpeg_end 00:00 progress 01:35 fake_progress 01:45 best_time 03:28 credits_start 00:00 credits_end 00:00
2019-12-12 11:48:35,413 :: bw_plex :: DEBUG :: plex.py:1227 :: Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e11 is in the correct time range theme_end
2019-12-12 11:48:44,632 :: bw_plex :: DEBUG :: plex.py:1186 :: Found Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e11 theme start 01:32, theme end 03:28, ffmpeg_end 00:00 progress 01:44 fake_progress 01:54 best_time 03:28 credits_start 00:00 credits_end 00:00
2019-12-12 11:48:44,632 :: bw_plex :: DEBUG :: plex.py:1227 :: Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e11 is in the correct time range theme_end
2019-12-12 11:48:44,668 :: bw_plex :: ERROR :: plex.py:1024 :: Cant connect to Chrome
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/connection.py", line 74, 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.6/dist-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.6/http/client.py", line 1254, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1300, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1249, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1036, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 974, in send
self.connect()
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 164, in _new_conn
% (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7f117c213f28>, 'Connection to 172.19.0.2 timed out. (connect timeout=30)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='172.19.0.2', port=32400): Max retries exceeded with url: /resources(Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f117c213f28>, 'Connection to 172.19.0.2 timed out. (connect timeout=30)'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/bw_plex/bw_plex/plex.py", line 1013, in client_action
correct_client.connect()
File "/usr/local/lib/python3.6/dist-packages/plexapi/client.py", line 92, in connect
data = self.query(self.key, timeout=timeout)
File "/usr/local/lib/python3.6/dist-packages/plexapi/client.py", line 161, in query
response = method(url, headers=headers, timeout=timeout, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 504, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='172.19.0.2', port=32400): Max retries exceeded with url: /resources (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f117c213f28>, 'Connection to 172.19.0.2 timedout. (connect timeout=30)'))
2019-12-12 11:48:44,678 :: bw_plex :: DEBUG :: plex.py:1038 :: calculated_offset 238 0.238
2019-12-12 11:49:14,695 :: bw_plex :: ERROR :: plex.py:89 :: There was an exception in client_action
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/connection.py", line 74, 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.6/dist-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.6/http/client.py", line 1254, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1300, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1249, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1036, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 974, in send
self.connect()
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 164, in _new_conn
% (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7f117c1c7e80>, 'Connection to 172.19.0.2 timed out. (connect timeout=30)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='172.19.0.2', port=32400): Max retries exceeded with url: /player/playback/seekTo?commandID=1&offset=238000&type=video (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f117c1c7e80>, 'Connection to 172.19.0.2 timed out. (connect timeout=30)'))
During handling of the above exception, another exception occurred:
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 1041, 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/client.py", line 161, in query
response = method(url, headers=headers, timeout=timeout, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 504, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='172.19.0.2', port=32400): Max retries exceeded with url: /player/playback/seekTo?commandID=1&offset=238000&type=video (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f117c1c7e80>, 'Connection to 172.19.0.2 timed out. (connect timeout=30)'))
This works everytime i try on chrome here. Can you check if Advertise as player Allow other Plex apps to fling content to this device and control it remotely. is checked?
I change some logic so the commands are now sent via the server if the client is a browser (Chrome, Edge or Firefox) so update the docker.
I will look into it tomorrow. Otherwise it has to wait 3 weeks because of other plans. I'll keep you updated aboute my findings 👍
Update!
The following is checked (I geuss this is default by Plex)
I'm running the latest container:
It looks like the logging is less? Because I see less errors 😂. But it still doesn't work.
2019-12-13 19:47:19,250 :: bw_plex :: DEBUG :: plex.py:1230 :: Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 is in the correct time range theme_end,
2019-12-13 19:48:10,379 :: bw_plex :: DEBUG :: plex.py:1189 :: Found Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 theme start 00:17, theme end 05:09, ffmpeg_end 00:00 progress 00:00 fake_progress 00:10 best_time 05:09 credits_start 00:00 credits_end 00:00,
2019-12-13 19:48:21,192 :: bw_plex :: DEBUG :: plex.py:1189 :: Found Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 theme start 00:17, theme end 05:09, ffmpeg_end 00:00 progress 01:04 fake_progress 01:14 best_time 05:09 credits_start 00:00 credits_end 00:00,
2019-12-13 19:48:21,193 :: bw_plex :: DEBUG :: plex.py:1230 :: Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 is in the correct time range theme_end,
2019-12-13 19:48:21,193 :: bw_plex :: DEBUG :: plex.py:1158 :: Called jump with Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 21 309.9399546485261 None,
2019-12-13 19:48:21,194 :: bw_plex :: INFO :: plex.py:932 :: Called client_action with 309.9399546485261 05:09 21 None,
2019-12-13 19:48:21,205 :: bw_plex :: INFO :: plex.py:965 :: sessionkey 21 media_sessionkey 21,
2019-12-13 19:48:21,205 :: bw_plex :: INFO :: plex.py:969 :: client Chrome 64.0,
2019-12-13 19:48:21,206 :: bw_plex :: INFO :: plex.py:996 :: Checking if we cant find the correct client,
2019-12-13 19:48:21,206 :: bw_plex :: INFO :: plex.py:998 :: 80qz6koh1kpfb49ac0xqv1s4 80qz6koh1kpfb49ac0xqv1s4,
2019-12-13 19:48:21,206 :: 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 1014, in client_action,
if correct_client._baseurl and correct_client.name not in browsers:,
AttributeError: 'PlexClient' object has no attribute 'name',
2019-12-13 19:48:28,105 :: bw_plex :: DEBUG :: plex.py:1189 :: Found Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 theme start 00:17, theme end 05:09, ffmpeg_end 00:00 progress 01:10 fake_progress 01:20 best_time 05:09 credits_start 00:00 credits_end 00:00,
2019-12-13 19:48:28,106 :: bw_plex :: DEBUG :: plex.py:1230 :: Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 is in the correct time range theme_end,
2019-12-13 19:48:41,228 :: bw_plex :: DEBUG :: plex.py:1189 :: Found Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 theme start 00:17, theme end 05:09, ffmpeg_end 00:00 progress 01:14 fake_progress 01:24 best_time 05:09 credits_start 00:00 credits_end 00:00,
2019-12-13 19:48:41,228 :: bw_plex :: DEBUG :: plex.py:1230 :: Mobile.Suit.Gundam:.Iron-Blooded.Orphans.s02e13 is in the correct time range theme_end,
Also allot of time's I see only the "DEBUG" lines where it state the start end end of an intro, but nothing happends, normaly I would receive errors in the logging, but these are not there anymore.
Sorry about that, i commited a bug instead of a fix. It fixed now.
Can you try again?
Sorry I'm unable to test for you right now, I'm on holiday
Is this fixed?
Still on holiday I fly back tomorrow, so this weekend I'm able to test.
I've just tested again and im unable to skip. In the logs i see the following.
2020-01-05 10:13:00,720 :: bw_plex :: INFO :: init.py:172 :: Using bw_plex version 0.1.dev1+gd2ce7ed 2020-01-05 10:13:00,721 :: bw_plex :: INFO :: init.py:173 :: default folder set to /config 2020-01-05 10:13:01,030 :: bw_plex :: INFO :: plex.py:1387 :: Added signal handler. 2020-01-05 10:13:01,036 :: bw_plex :: DEBUG :: misc.py:64 :: Getting server bas-server 2020-01-05 10:13:01,037 :: bw_plex :: DEBUG :: misc.py:572 :: Getting hashtable 2020-01-05 10:13:01,106 :: bw_plex :: INFO :: misc.py:658 :: Loading existing files in db Aborted!
Delete the db and hashes file.
It's working :)
On Windows:
On my smartphone, if I look at the logs I see one error, but it works. It will skip the intro
yeah, plexapi fails to read the response from the client (the client sends invalid xml) what is it a chrome browser?
Sorry on my smartphone I've used the plex app
What the is the os and the client version?
Android 9.0.9 (oxygenOS, not that it will matter) plex app version 7.26.0.14578
Thanks, ill close this for now then.
Sure thing. Nice that it works and thanks for your awesome extension to plex
Hello,
Is it known that the intro's doesn't get skipped for Windows 10 and MacOS? Android is not a problem, because there it would skip as expected.
I'm using the latest chrome version. I didn't test it in other browsers.
Logs