mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 07:47:39 +00:00
修复了无法删除缓存文件的bug
This commit is contained in:
parent
071d17a579
commit
9a6dd4662b
@ -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。"
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user