From f28bf974787c022d3d6fff65c8e938194572b584 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 5 Dec 2021 23:48:02 +0800 Subject: [PATCH] =?UTF-8?q?neteasedown=20=E5=AF=B9=E5=A5=87=E6=80=AA?= =?UTF-8?q?=E6=AD=8C=E6=9B=B2=E5=90=8D=E8=BF=9B=E8=A1=8C=E8=BD=AC=E4=B9=89?= =?UTF-8?q?+=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 4 ++-- neteasedown.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/list.json b/list.json index 50947e3..aa50205 100644 --- a/list.json +++ b/list.json @@ -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。" diff --git a/neteasedown.py b/neteasedown.py index 58b844a..a658182 100644 --- a/neteasedown.py +++ b/neteasedown.py @@ -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(