mirror of
https://github.com/MeoProject/lx-music-api-server.git
synced 2025-05-23 19:17:41 +08:00
feat: tx源cdn地址切换
This commit is contained in:
parent
0618b30dbe
commit
aad3a71427
@ -39,6 +39,7 @@ tools = jsobject({
|
||||
"loginuin": config.read_config("module.tx.user.uin"),
|
||||
"guid": config.read_config("module.tx.vkeyserver.guid"),
|
||||
"uin": config.read_config("module.tx.vkeyserver.uin"),
|
||||
"cdnaddr": config.read_config("module.tx.cdnaddr") if config.read_config("module.tx.cdnaddr") else 'http://ws.stream.qqmusic.qq.com/',
|
||||
})
|
||||
|
||||
|
||||
@ -81,4 +82,4 @@ async def url(songId, quality):
|
||||
# js const { purl } = data.req_0.data.midurlinfo[0]
|
||||
if (not body.req_0.data.midurlinfo[0]['purl']):
|
||||
raise FailedException('failed')
|
||||
return 'http://ws.stream.qqmusic.qq.com/' + body.req_0.data.midurlinfo[0]['purl']
|
||||
return tools.cdnaddr + body.req_0.data.midurlinfo[0]['purl']
|
||||
|
@ -141,7 +141,8 @@ default = {
|
||||
"qqmusic_key": "",
|
||||
"uin": "",
|
||||
"_uin-desc": "key对应的QQ号"
|
||||
}
|
||||
},
|
||||
"cdnaddr": "http://ws.stream.qqmusic.qq.com/",
|
||||
},
|
||||
"wy": {
|
||||
"desc": "网易云音乐相关配置",
|
||||
@ -360,6 +361,7 @@ def push_to_list(key, obj):
|
||||
|
||||
|
||||
def read_config(key):
|
||||
try:
|
||||
config = variable.config
|
||||
keys = key.split('.')
|
||||
value = config
|
||||
@ -375,6 +377,9 @@ def read_config(key):
|
||||
break
|
||||
|
||||
return value
|
||||
except:
|
||||
logger.warning(f'配置文件{key}不存在')
|
||||
return None
|
||||
|
||||
|
||||
def initConfig():
|
||||
|
@ -11,7 +11,6 @@
|
||||
import logging
|
||||
import colorlog
|
||||
import os
|
||||
import traceback
|
||||
from pygments import highlight
|
||||
from pygments.lexers import PythonLexer
|
||||
from pygments.formatters import TerminalFormatter
|
||||
|
Loading…
x
Reference in New Issue
Block a user