mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
修复音乐检索无法正常抛出自定义异常bug
This commit is contained in:
parent
086b06f62c
commit
eb16a2f1b2
1 changed files with 1 additions and 1 deletions
|
|
@ -162,7 +162,7 @@ def netease_music_search(keyword,session):
|
||||||
if songs:
|
if songs:
|
||||||
filtered_data = [item for item in songs if item.get('fee') == 8]# 过滤掉付费歌曲
|
filtered_data = [item for item in songs if item.get('fee') == 8]# 过滤掉付费歌曲
|
||||||
num = 0
|
num = 0
|
||||||
if len(filtered_data) - 1 <= 0:
|
if len(filtered_data) - 1 <= 0: # 判断返回内容是否为空
|
||||||
return None, None, None, None
|
return None, None, None, None
|
||||||
num = Random().randint(0, len(filtered_data) - 1)
|
num = Random().randint(0, len(filtered_data) - 1)
|
||||||
first_song = filtered_data[num] # 获取第一首歌曲
|
first_song = filtered_data[num] # 获取第一首歌曲
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue