🚸 netease 在歌曲上添加试听链接

This commit is contained in:
xtaodada 2020-08-12 02:14:16 +08:00
parent f5650b8507
commit a668e1acb5
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 4 additions and 2 deletions

View File

@ -102,7 +102,7 @@
},
{
"name": "netease",
"version": "1.0",
"version": "1.1",
"section": "daily",
"maintainer": "xtaodada、KorenKrita",
"size": "0.7 kb",

View File

@ -11,7 +11,9 @@ async def netease(context):
req = get("https://api.oioweb.cn/api/wyypl.php")
if req.status_code == 200:
data = json.loads(req.text)
res = data['Comment'] + '\n\n来自 @' + data['UserName'] + ' 在鸽曲"' + data['SongName'] + '"-' + data['SongAutho'] + '</a>下方的评论'
res = data['Comment'] + '\n\n来自 @' + data[
'UserName'] + ' 在鸽曲"<a href="http://music.163.com/song/media/outer/url?id=' + data['SongId'] + '.mp3">' + \
data['SongName'] + '</a>"-' + data['SongAutho'] + '</a>下方的评论'
await context.edit(res, parse_mode='html', link_preview=True)
else:
await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")