mdhiggins / PlexAutoSkip

Automatically skip content in Plex
MIT License
205 stars 11 forks source link

Custom.json not working #72

Open bzbybt opened 2 days ago

bzbybt commented 2 days ago

I love your script! PlexAutoSkip is working perfectly for a few days. I am now trying to get the custom.json to work. I have an anime ("Black Clover") that I want to skip ahead to the 4 minute and 15 second mark because there is an intro, followed by a recap and then a 2nd intro which usually ends around the 4 minute mark. Below is the code I am using. I have tried the GUID (IMDB/TMDB/TVDB) and the ratingKey from the Plex XML but it's not triggering. I have also tried to Start it at 0 or -20000 but that didn't work either. Auto Skip still works for the 1st Intro but not the custom instructions. I am using the Docker version. What am I doing wrong?

{
    "markers": {
        "imdb://tt7441658": [
            {
                "start": 20000,
                "end": 255000,
                "cascade": false
            }
                        ],
                },
    "offsets": {},
    "tags": {},
    "allowed": {
        "users": [],
        "clients": [],
        "keys": [],
        "skip-next": []
    },
    "blocked": {
        "users": [],
        "clients": [],
        "keys": [
            "imdb://tt7441658"
        ],
        "skip-next": []
    },
    "clients": {},
    "mode": {}
}
mdhiggins commented 2 days ago

JSON looks correct

{
    "markers": {
        "imdb://tt7441658": [
            {
                "start": 20000,
                "end": 255000,
                "cascade": false
            }
        ]
    },
    "offsets": {},
    "tags": {},
    "allowed": {
        "users": [],
        "clients": [],
        "keys": [],
        "skip-next": []
    },
    "blocked": {
        "users": [],
        "clients": [],
        "keys": [
            "imdb://tt7441658"
        ],
        "skip-next": []
    },
    "clients": {},
    "mode": {}
}

Might want to turn on debug logging and try seeing if that gives any insight. Turn it on and do a fresh container start and watch both the loading process where the IDs are resolved to GUIDs and also during playback of an episode, feel free to post it and I can take a look

https://github.com/mdhiggins/PlexAutoSkip/wiki/Debug-Level-Logging

bzbybt commented 17 hours ago

Here's the debug log.

2024-11-12 21:12:44 - __main__ - INFO - /usr/local/pas/venv/bin/python3
2024-11-12 21:12:44 - __main__ - INFO - Loading config file /usr/local/pas/config/config.ini.
2024-11-12 21:12:44 - __main__ - ERROR - Found custom file /usr/local/pas/config/custom.json but failed to load, using defaults
Traceback (most recent call last):
  File "/usr/local/pas/resources/settings.py", line 243, in loadCustom
    data = json.load(f)
  File "/usr/lib/python3.10/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 10 column 5 (char 116)
2024-11-12 21:12:44 - __main__ - INFO - Loading custom JSON file /usr/local/pas/config/custom.json
2024-11-12 21:12:44 - __main__ - INFO - Connecting to Plex server...
2024-11-12 21:13:15 - __main__ - INFO - Connected to Plex server <deleted> using plex.tv account
2024-11-12 21:13:15 - __main__ - INFO - Skipper initiated and ready
2024-11-12 21:13:15 - websocket - INFO - Websocket connected
2024-11-12 21:14:21 - __main__ - INFO - Session 9 [809709] (Black Clover s01e35 - The Light of Judgment) <deleted>|1e0d551a9dtxtjtug1ri9ryr shares player (1e0d551a9dtxtjtug1ri9ryr) with new session 10 [781206] (Black Clover s01e28 - The One I’ve Set My Heart On) <deleted>|1e0d551a9dtxtjtug1ri9ryr, deleting old session 9
2024-11-12 21:14:24 - __main__ - INFO - Found skippable marker intro for media 10 [781206] (Black Clover s01e28 - The One I’ve Set My Heart On) <deleted>|1e0d551a9dtxtjtug1ri9ryr with range 1485(+3000)-28811(+1000) and viewOffset 3486
mdhiggins commented 17 hours ago

Looks like its failing to load your JSON file and gives you a clear reason why, just gotta fix that

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 10 column 5 (char 116)