I think the trouble is updating the rss feeds to the simple database using db.update on line 41 of feedtools.py
I don't think that function cares about valid json. So load everything into a valid json object using json.load(tmp) and then update that to the SimpleDatabase
in my opinion this is always a better approach than small fixes by hand, now its a #, next time its a "\/". json.loads does that all for you perfectly.
the python3 json library can already do that with the load and loads function.
https://pynative.com/python-json-validation/
I think the trouble is updating the rss feeds to the simple database using db.update on line 41 of feedtools.py
I don't think that function cares about valid json. So load everything into a valid json object using json.load(tmp) and then update that to the SimpleDatabase
in my opinion this is always a better approach than small fixes by hand, now its a #, next time its a "\\/". json.loads does that all for you perfectly.
Hmm, maybe a short replacement search/replace can be done? Or are there other ways in Python to check if a JSON object is "safe"?
the python3 json library can already do that with the load and loads function.
https://pynative.com/python-json-validation/
I think the trouble is updating the rss feeds to the simple database using db.update on line 41 of feedtools.py
I don't think that function cares about valid json. So load everything into a valid json object using json.load(tmp) and then update that to the SimpleDatabase
in my opinion this is always a better approach than small fixes by hand, now its a #, next time its a "\/". json.loads does that all for you perfectly.