add sanitized for all
This commit is contained in:
parent
2c04d7ce6f
commit
cfd61f4b71
2 changed files with 4 additions and 2 deletions
|
|
@ -37,6 +37,6 @@ class ScriptUtils:
|
||||||
elif isinstance(value, bool):
|
elif isinstance(value, bool):
|
||||||
out = f"{{%bool({value})}}"
|
out = f"{{%bool({value})}}"
|
||||||
else:
|
else:
|
||||||
out = f"{{%from_json('''{json.dumps(value, ensure_ascii=False)}''')}}"
|
out = f"{{%from_json('''{json.dumps(value, ensure_ascii=False, sort_keys=True)}''')}}"
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,9 @@ from ytdl_sub.utils.script import ScriptUtils
|
||||||
class Scriptable(ABC):
|
class Scriptable(ABC):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.script = Script(
|
self.script = Script(
|
||||||
dict(copy.deepcopy(VARIABLE_SCRIPTS), **copy.deepcopy(CUSTOM_FUNCTION_SCRIPTS))
|
ScriptUtils.add_sanitized_variables(
|
||||||
|
dict(copy.deepcopy(VARIABLE_SCRIPTS), **copy.deepcopy(CUSTOM_FUNCTION_SCRIPTS))
|
||||||
|
)
|
||||||
)
|
)
|
||||||
self.unresolvable: Set[str] = copy.deepcopy(UNRESOLVED_VARIABLES)
|
self.unresolvable: Set[str] = copy.deepcopy(UNRESOLVED_VARIABLES)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue