mirror of
https://github.com/MeoProject/lx-music-api-server.git
synced 2025-05-23 19:17:41 +08:00
fix: 修复两个小bug
This commit is contained in:
parent
a20367b86e
commit
71dff0a1ff
@ -82,7 +82,7 @@ async def generate_script_response(request):
|
|||||||
oline = line
|
oline = line
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if (line.startswith('const API_URL')):
|
if (line.startswith('const API_URL')):
|
||||||
newScriptLines.append(f'const API_URL = "{request.scheme}://{request.host}"')
|
newScriptLines.append(f'''const API_URL = "{'https' if config.read_config('common.ssl_info.is_https') else 'http'}://{request.host}"''')
|
||||||
elif (line.startswith('const API_KEY')):
|
elif (line.startswith('const API_KEY')):
|
||||||
newScriptLines.append(f'const API_KEY = "{config.read_config("security.key.value")}"')
|
newScriptLines.append(f'const API_KEY = "{config.read_config("security.key.value")}"')
|
||||||
elif (line.startswith("* @name")):
|
elif (line.startswith("* @name")):
|
||||||
@ -103,10 +103,10 @@ async def generate_script_response(request):
|
|||||||
|
|
||||||
return Response(text = r, content_type = 'text/javascript',
|
return Response(text = r, content_type = 'text/javascript',
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Disposition': f'attachment; filename={
|
'Content-Disposition': f'''attachment; filename={
|
||||||
config.read_config("common.download_config.filename")
|
config.read_config("common.download_config.filename")
|
||||||
if config.read_config("common.download_config.filename").endswith(".js")
|
if config.read_config("common.download_config.filename").endswith(".js")
|
||||||
else (config.read_config("common.download_config.filename" + ".js"))}'
|
else (config.read_config("common.download_config.filename" + ".js"))}'''
|
||||||
})
|
})
|
||||||
|
|
||||||
if (config.read_config('common.allow_download_script')):
|
if (config.read_config('common.allow_download_script')):
|
||||||
|
1
main.py
1
main.py
@ -30,6 +30,7 @@ import modules
|
|||||||
import asyncio
|
import asyncio
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
def handleResult(dic, status = 200):
|
def handleResult(dic, status = 200):
|
||||||
return Response(body = json.dumps(dic, indent=2, ensure_ascii=False), content_type='application/json', status = status)
|
return Response(body = json.dumps(dic, indent=2, ensure_ascii=False), content_type='application/json', status = status)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user