随机50首歌

This commit is contained in:
liuwei
2025-06-03 17:42:09 +08:00
parent bfc0a48d50
commit 025a02d031

View File

@@ -307,7 +307,7 @@ class GuessSongPlugin(MessagePluginInterface):
# 构建API请求URL - 使用抖音音乐API
if singer_name:
# 如果指定了歌手,搜索该歌手的歌曲
api_url = f"https://hhlqilongzhu.cn/api/dg_douyinmusic.php?msg={singer_name}&type=json"
api_url = f"https://hhlqilongzhu.cn/api/dg_douyinmusic.php?msg={singer_name}&type=json&num=50"
else:
# 如果没有指定歌手,使用热门歌手列表
popular_singers = [
@@ -316,7 +316,7 @@ class GuessSongPlugin(MessagePluginInterface):
"王菲", "张惠妹", "孙燕姿", "蔡依林", "五月天"
]
random_singer = random.choice(popular_singers)
api_url = f"https://hhlqilongzhu.cn/api/dg_douyinmusic.php?msg={random_singer}&type=json"
api_url = f"https://hhlqilongzhu.cn/api/dg_douyinmusic.php?msg={random_singer}&type=json&num=50"
# 发送请求获取歌曲列表
response = requests.get(api_url)