From 9a6dd4662b3a9c79dc0a93d177a356e4011492d6 Mon Sep 17 00:00:00 2001 From: TNTcraftHIM Date: Tue, 25 Aug 2020 22:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=BC=93=E5=AD=98=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 4 ++-- neteaseshuffle.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/list.json b/list.json index 1f93450..b8686d3 100644 --- a/list.json +++ b/list.json @@ -272,10 +272,10 @@ }, { "name": "neteaseshuffle", - "version": "1.0", + "version": "1.1", "section": "daily", "maintainer": "TNTcraftHIM", - "size": "3.1 kb", + "size": "3.0 kb", "supported": true, "des-short": "随机网抑热歌", "des": "从热歌榜随机获取一首歌,可以多进程同开,且附带歌曲信息。命令:ns。" diff --git a/neteaseshuffle.py b/neteaseshuffle.py index 4a84174..f9d8bd1 100644 --- a/neteaseshuffle.py +++ b/neteaseshuffle.py @@ -26,7 +26,7 @@ async def ns(context): headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063', "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"} music = requests.request("GET", music, headers=headers) - name = "/nstmp" + str(req['data']['name']) + ".mp3" + name = str(req['data']['name']) + ".mp3" with open(name, 'wb') as f: f.write(music.content) if (path.getsize(name) / 1024) < 100: @@ -57,12 +57,12 @@ async def ns(context): caption=cap, link_preview=False, force_document=False) - status = True - break try: remove(name) except: pass + status = True + break else: continue if status == False: