dmunozv04 / iSponsorBlockTV

SponsorBlock client for all YouTube TV clients.
GNU General Public License v3.0
2.18k stars 90 forks source link

Will not start v2.0.3 #112

Closed mscreations closed 7 months ago

mscreations commented 7 months ago

Before opening an issue make sure that there are no duplicates and that you are on the latest version. Describe the bug I recently updated my docker image to v2.0.3 but the container will not start. I get an exception

Arguments: (200, 'OK')
Connected to device None (Living Room TV)
--- Logging error ---
Traceback (most recent call last):
  File "/app/iSponsorBlockTV/ytlounge.py", line 180, in connect
    self._process_events(events)
  File "/usr/local/lib/python3.11/site-packages/pyytlounge/wrapper.py", line 325, in _process_events
    self._process_event(event_id, event_type, args)
  File "/app/iSponsorBlockTV/ytlounge.py", line 112, in _process_event
    device_info = json.loads(device.get("deviceInfo", ""))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1110, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 953, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 687, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 377, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "/app/main.py", line 3, in <module>
    helpers.app_start()
  File "/app/iSponsorBlockTV/helpers.py", line 126, in app_start
    main.main(config, args.debug)
  File "/app/iSponsorBlockTV/main.py", line 144, in main
    loop.run_forever()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1922, in _run_once
    handle._run()
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/app/iSponsorBlockTV/main.py", line 48, in loop
    await lounge_controller.connect()
  File "/app/iSponsorBlockTV/ytlounge.py", line 184, in connect
    self._logger.exception(ex, resp.status, resp.reason)
Message: JSONDecodeError('Expecting value: line 1 column 1 (char 0)')

I tried clearing my config completely and recreating it but still getting the error. Rolling back to v2.0.2 fixes the issue.

iSponsorBlockTV server (please complete the following information):

Apple TV (please complete the following information):

dmunozv04 commented 7 months ago

I think I've identified the issue. It looks like your TV isn't reporting the deviceInfo (as other devices do), and my placeholder device_info = json.loads(device.get("deviceInfo", "")) was wrong. I'll release v2.0.4 with a fix soon

dmunozv04 commented 7 months ago

I've just published v2.0.4

mscreations commented 7 months ago

Can confirm v2.0.4 fixed the issue. Thanks for the quick response and fix!

dmunozv04 commented 7 months ago

You're welcome!