mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 00:04:32 +00:00
neteasedown 对奇怪歌曲名进行转义+文件大小提示
This commit is contained in:
parent
5e0308067a
commit
f28bf97478
@ -292,10 +292,10 @@
|
||||
},
|
||||
{
|
||||
"name": "neteasedown",
|
||||
"version": "1.22",
|
||||
"version": "1.221",
|
||||
"section": "daily",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "11.1 kb",
|
||||
"size": "11.4 kb",
|
||||
"supported": true,
|
||||
"des-short": "网易云搜歌/点歌",
|
||||
"des": "可以在线搜索并且快速点歌,支持解锁VIP歌曲。命令:ned。"
|
||||
|
@ -231,19 +231,25 @@ async def ned(context):
|
||||
if track_info["data"][0]["code"] == 404:
|
||||
await context.edit(f"**没有找到歌曲**,请检查歌曲id是否正确。")
|
||||
return
|
||||
await context.edit(f"正在下载歌曲:**{song_info['songs'][0]['name']} - {gen_author(song_info)}**")
|
||||
await context.edit(f"正在下载歌曲:**{song_info['songs'][0]['name']} - {gen_author(song_info)}** "
|
||||
f"{round(track_info['data'][0]['size'] / 1000 / 1000, 2)} MB")
|
||||
# 下载歌曲并且设置歌曲标签
|
||||
song = TrackHelper(song_info['songs'][0])
|
||||
# 转义
|
||||
for char in song_info["songs"][0]["name"]:
|
||||
if char in ['/', '\\', ':', '*', '?', '"', '<', '>', '|']:
|
||||
song_info["songs"][0]["name"] = song_info["songs"][0]["name"].replace(char, '')
|
||||
path = await netease_down(track_info, song_info, song)
|
||||
await context.edit("正在上传歌曲。。。")
|
||||
# 上传歌曲
|
||||
cap_ = ""
|
||||
# 提醒登录VIP账号
|
||||
if track_info["data"][0]["freeTrialInfo"]:
|
||||
cap_ = f"**非VIP,正在试听 {track_info['data'][0]['freeTrialInfo']['start']}s ~ " \
|
||||
cap_ = f"**非VIP,正在试听 {track_info['data'][0]['freeTrialInfo']['start']}s ~ \n" \
|
||||
f"{track_info['data'][0]['freeTrialInfo']['end']}s**\n"
|
||||
cap = f"「**{song_info['songs'][0]['name']}**」\n" \
|
||||
f"{gen_author(song_info)}\n" \
|
||||
f"文件大小:{round(track_info['data'][0]['size'] / 1000 / 1000, 2)} MB\n" \
|
||||
f"\n{cap_}" \
|
||||
f"#netease #{int(track_info['data'][0]['br'] / 1000)}kbps #{track_info['data'][0]['type']}"
|
||||
await context.client.send_file(
|
||||
|
Loading…
Reference in New Issue
Block a user