[Dictionary] Be more specific on replacing
Thanks Axas.
This commit is contained in:
@@ -127,7 +127,7 @@ class Dictionary(commands.Cog):
|
||||
if "window.INITIAL_STATE" in item.string:
|
||||
content = item.string
|
||||
content = content.lstrip("window.INITIAL_STATE =").rstrip(";")
|
||||
content = content.replace("undefined", '"None"').replace("true", '"True"').replace("false", '"False"')
|
||||
content = content.replace("undefined", '"None"').replace(": true", ': "True"').replace(": false", ': "False"')
|
||||
try:
|
||||
website_data = json.loads(content)
|
||||
except json.decoder.JSONDecodeError:
|
||||
|
||||
Reference in New Issue
Block a user