Hellowlol / bw_plex

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

Chromecast playback via Android breaks #104

Closed nelsonblaha closed 4 years ago

nelsonblaha commented 4 years ago
2019-09-18 02:21:44,621 :: bw_plex :: INFO :: plex.py:932 :: Called client_action with 71.84253968253968 01:11 214 None
2019-09-18 02:21:44,630 :: bw_plex :: INFO :: plex.py:965 :: sessionkey 214 media_sessionkey 187
2019-09-18 02:21:44,630 :: bw_plex :: INFO :: plex.py:965 :: sessionkey 214 media_sessionkey 212
2019-09-18 02:21:44,630 :: bw_plex :: INFO :: plex.py:965 :: sessionkey 214 media_sessionkey 214
2019-09-18 02:21:44,630 :: bw_plex :: INFO :: plex.py:969 :: client Chromecast 9.0
2019-09-18 02:21:44,631 :: bw_plex :: DEBUG :: plex.py:987 :: The client is a chromecast and on the local network.
2019-09-18 02:21:52,640 :: bw_plex :: ERROR :: plex.py:85 :: There was an exception in client_action
Traceback (most recent call last):
  File "/app/bw_plex/bw_plex/chromecast.py", line 270, in get_chromecast_player
    cast = pychromecast.Chromecast(host=host)
  File "/usr/local/lib/python3.6/dist-packages/pychromecast/__init__.py", line 213, in __init__
    "Could not connect to {}:{}".format(self.host, self.port)
pychromecast.error.ChromecastConnectionError: Could not connect to 192.168.86.95:8009

During handling of the above exception, another exception occurred:

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 991, in client_action
    pc, cast = log_exception(get_chromecast_player(client.address, 'Chromecast'))
  File "/app/bw_plex/bw_plex/chromecast.py", line 277, in get_chromecast_player
    cast = chromecasts[0]
IndexError: list index out of range
2019-09-18 02:21:54,619 :: bw_plex :: DEBUG :: plex.py:1197 :: Found Orange.Is.the.New.Black.s07e01 theme start 00:10, theme end 01:11, ffmpeg_end 01:18 progress 00:19 best_time 01:11 credits_start 00:00 credits_end 00:00
2019-09-18 02:21:54,620 :: bw_plex :: DEBUG :: plex.py:1228 :: Orange.Is.the.New.Black.s07e01 is in the correct time range theme_end
2019-09-18 02:22:04,617 :: bw_plex :: DEBUG :: plex.py:1197 :: Found Orange.Is.the.New.Black.s07e01 theme start 00:10, theme end 01:11, ffmpeg_end 01:18 progress 00:29 best_time 01:11 credits_start 00:00 credits_end 00:00
2019-09-18 02:22:04,617 :: bw_plex :: DEBUG :: plex.py:1228 :: Orange.Is.the.New.Black.s07e01 is in the correct time range theme_end
Hellowlol commented 4 years ago

So what happens here is that we try to connect to the chromecast using the info we got about the client from plex. When that fails, we query the network for chromecast and that fails. I just assumed that if we reached to far we should find the client. I’ll add a better error message. You need to manually test the PyChromecast package on your network.

Hellowlol commented 4 years ago

I have added a better log so im closing this.