dmunozv04 / iSponsorBlockTV

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

JSONDecodeError when running main.py #1

Closed Flute7 closed 2 years ago

Flute7 commented 2 years ago

Hello, I have followed all setup instructions; Installed dependencies, grabbed Identifier and credentials and filled in config.json. When running "python3 main.py" I get the following error. I have checked for issues in config.json and all looks ok. My knowledge of python is very limited so I am hoping you have an easy answer.

Thank You. Cool project, looking forward to the Docker deployment!

Traceback (most recent call last): File "main.py", line 134, in atv_config, apikey, categories = load_config() File "main.py", line 130, in load_config config = json.load(f) File "/usr/lib/python3.8/json/init.py", line 293, in load return loads(fp.read(), File "/usr/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/usr/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid control character at: line 4 column 347 (char 363)

dmunozv04 commented 2 years ago

Hello, could you upload your config.json file, removing first the secrets, please? I can’t seem to replicate the issue

Flute7 commented 2 years ago

Sure thing. I have renamed config.json to config.json.log to allow github upload. I have replaced all secrets with template values.

config.json.log

nocturne1 commented 2 years ago

Sure thing. I have renamed config.json to config.json.log to allow github upload. I have replaced all secrets with template values.

@Flute7, you might want to double-check that file you uploaded. It does not appear to be template values. I suggest you remove and revoke the API key to be safe.

Flute7 commented 2 years ago

Sure thing. I have renamed config.json to config.json.log to allow github upload. I have replaced all secrets with template values.

@Flute7, you might want to double-check that file you uploaded. It does not appear to be template values. I suggest you remove and revoke the API key to be safe.

Thanks but it's ok. I used an encryption generator to create the random values to look exactly like the real thing. They are in no way related to my actual credentials.

Appreciate the heads up anyway.

dmunozv04 commented 2 years ago

@Flute7 could you try using docker, as it may be more reliable?

Flute7 commented 2 years ago

Just pulled the docker image. Its working perfectly, thank you!

Two notes for reference to anyone who is setting this up,

To verify that this is functioning. iSponsorBlockTV successfully skips the sponsor segment starting at 1:05 in this video (https://www.youtube.com/watch?v=bFNJVaO9E-o).

Perhaps obvious, but the device discovery (port 5353) will conflict with other docker services you may be using such as Plex, Home Assistant, etc. You will need to change/disable these other 5353 ports to allow iSponsorBlockTV to work.