feat: 支持在配置文件中自定义下载的源脚本的基础信息

This commit is contained in:
helloplhm-qwq
2023-12-24 15:56:00 +08:00
parent da0737ecfd
commit 37f1b5bbb0
2 changed files with 18 additions and 1 deletions

View File

@ -55,6 +55,16 @@ async def generate_script_response(request):
newScriptLines.append(f'const API_URL = "{request.scheme}://{request.host}"')
elif (line.startswith('const API_KEY')):
newScriptLines.append(f'const API_KEY = "{config.read_config("security.key.value")}"')
elif (line.startswith("/*")):
newScriptLines.append(" /*")
elif (line.startswith("* @name")):
newScriptLines.append(" * @name " + config.read_config("common.download_config.name"))
elif (line.startswith("* @description")):
newScriptLines.append(" * @description " + config.read_config("common.download_config.intro"))
elif (line.startswith("* @author")):
newScriptLines.append((" * @author helloplhm-qwq & Folltoshe & " + config.read_config("common.download_config.author")) if config.read_config("common.download_config.author") else " * @author helloplhm-qwq & Folltoshe")
elif (line.startswith("* @version")):
newScriptLines.append(" * @name " + config.read_config("common.download_config.version"))
else:
newScriptLines.append(line)