feat: 账号池功能 & feat: 优化黑名单检查性能 & feat: scheduler支持传参

This commit is contained in:
helloplhm-qwq
2024-01-05 17:18:33 +08:00
parent ef4b4bfa24
commit c08b45586c
11 changed files with 242 additions and 60 deletions

View File

@ -6,8 +6,9 @@
# - license: MIT -
# ----------------------------------------
# This file is part of the "lx-music-api-server" project.
import random
from common.exceptions import FailedException
from common import utils
from common import config, utils, variable
from .utils import getKey, signRequest, tools
from .musicInfo import getMusicInfo
import time
@ -25,20 +26,21 @@ async def url(songId, quality):
if (not albumaudioid):
albumaudioid = ""
thash = thash.lower()
user_info = config.read_config('module.kg.user') if (not variable.use_cookie_pool) else random.choice(config.read_config('module.cookiepool.kg'))
params = {
'album_id': albumid,
'userid': tools.userid,
'userid': user_info['userid'],
'area_code': 1,
'hash': thash,
'module': '',
'mid': tools.mid,
'mid': user_info['mid'],
'appid': tools.appid,
'ssa_flag': 'is_fromtrack',
'clientver': tools.clientver,
'open_time': time.strftime("%Y%m%d"),
'vipType': 6,
'ptype': 0,
'token': tools.token,
'token': user_info['token'],
'auth': '',
'mtype': 0,
'album_audio_id': albumaudioid,