diff --git a/list.json b/list.json index dee658f..6275ea5 100644 --- a/list.json +++ b/list.json @@ -102,7 +102,7 @@ }, { "name": "netease", - "version": "1.3", + "version": "1.31", "section": "daily", "maintainer": "xtaodada、KorenKrita", "size": "0.7 kb", diff --git a/netease.py b/netease.py index cf7bf5d..c59ebd4 100644 --- a/netease.py +++ b/netease.py @@ -8,12 +8,16 @@ from pagermaid.listener import listener description="随机一条网易云音乐评论。") async def netease(context): await context.edit("获取中 . . .") - req = get("https://api.oioweb.cn/api/wyypl.php") + try: + req = get("https://api.66mz8.com/api/music.163.php?format=json") + except: + await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。") + return if req.status_code == 200: data = json.loads(req.text) - res = data['Comment'] + '\n\n来自 @' + data[ - 'UserName'] + ' 在鸽曲 ' + \ - data['SongName'] + ' --by' + data['SongAutho'] + '' + ' 下方的评论\n\n该评论获得了' + str(data['likedCount']) + '个赞!' + res = data['comments'] + '\n\n来自 @' + data[ + 'nickname'] + ' 在鸽曲 ' + \ + data['name'] + ' --by' + data['artists_name'] + '' + ' 下方的评论。' await context.edit(res, parse_mode='html', link_preview=True) else: await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")