From c3b9ea60705073d82eaef55f71c3cb400b7b641f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onimai=EF=BC=81?= <93068569+Onimaimai@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:38:14 +0000 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- nonebot_plugin_voicemusic/__init__.py | 8 ++++---- nonebot_plugin_voicemusic/config.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 89b94ef..dbcc8eb 100644 --- a/README.md +++ b/README.md @@ -76,15 +76,15 @@ sudo apt install ffmpeg | 配置项 | 必填 | 说明 | |:-----:|:----:|:----:| -| UIN | 是 | 提供key的qq号 | -| KEY | 是 | qqmusic_key | +| uin | 是 | 提供key的qq号 | +| key | 是 | qqmusic_key | 例: ``` -UIN = "YOUR_UIN" # 请将这里的'YOUR_UIN'替换为提供key的qq号 +uin = "YOUR_uin" # 请将这里的'YOUR_uin'替换为提供key的qq号 ``` ``` -KEY = "YOUR_KEY" # 请将这里的'YOUR_KEY'替换为获取的qqmusic_key +key = "YOUR_key" # 请将这里的'YOUR_key'替换为获取的qqmusic_key ``` 获取qqmusic_key/qm_keyst的方法:[打开QQ音乐官网](https://y.qq.com/),登录后按f12并切换到应用(application)后在cookies中寻找参数填入就好 只能获取QQ音乐上有的音乐 diff --git a/nonebot_plugin_voicemusic/__init__.py b/nonebot_plugin_voicemusic/__init__.py index a3b599d..a9c87ba 100644 --- a/nonebot_plugin_voicemusic/__init__.py +++ b/nonebot_plugin_voicemusic/__init__.py @@ -23,9 +23,9 @@ # 加载插件配置 plugin_config = get_plugin_config(Config) uin = plugin_config.uin -skey = plugin_config.skey -if not uin or not skey: - logger.warning("语音点歌未配置 UIN 或 SKEY,建议在 .env 文件中进行配置") +key = plugin_config.key +if not uin or not key: + logger.warning("语音点歌未配置 uin 或 key,建议在 .env 文件中进行配置") # 创建一个异步锁 music_lock = asyncio.Lock() @@ -85,7 +85,7 @@ async def get_music_src(keyword: str) -> str | None: params = { "name": keyword, "uin": uin, - "skey": skey, + "key": key, "max": 3, "n": 1 } diff --git a/nonebot_plugin_voicemusic/config.py b/nonebot_plugin_voicemusic/config.py index d07154d..b0403af 100644 --- a/nonebot_plugin_voicemusic/config.py +++ b/nonebot_plugin_voicemusic/config.py @@ -2,4 +2,4 @@ class Config(BaseModel): uin: str = "" - skey: str = "" \ No newline at end of file + key: str = "" \ No newline at end of file