I was getting some errors, so I had to put "encoding='utf8'" in some places in the code, but now it is working fine. Although I still work on legacy 'appearances' and I will have to manually convert all files to that format, your script is going to save a lot of my time.
I still get "json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes" errors on some scenes, but I think those are just corrupted JSON files and it has nothing to do with your code.