Skip to content

Commit

Permalink
配置步骤
Browse files Browse the repository at this point in the history
  • Loading branch information
Onimaimai committed Nov 4, 2024
1 parent 7b38672 commit c3b9ea6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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音乐上有的音乐
Expand Down
8 changes: 4 additions & 4 deletions nonebot_plugin_voicemusic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("语音点歌未配置 UINSKEY,建议在 .env 文件中进行配置")
key = plugin_config.key
if not uin or not key:
logger.warning("语音点歌未配置 uinkey,建议在 .env 文件中进行配置")

# 创建一个异步锁
music_lock = asyncio.Lock()
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_voicemusic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

class Config(BaseModel):
uin: str = ""
skey: str = ""
key: str = ""

0 comments on commit c3b9ea6

Please sign in to comment.