This commit is contained in:
TNTcraftHIM 2020-08-29 19:41:08 +08:00
parent 397b959b01
commit 1a8406f8d8
2 changed files with 5 additions and 4 deletions

View File

@ -282,10 +282,10 @@
},
{
"name": "neteasemusic",
"version": "2.8",
"version": "2.9",
"section": "daily",
"maintainer": "TNTcraftHIM",
"size": "25.3 kb",
"size": "25.4 kb",
"supported": true,
"des-short": "网易云点歌",
"des": "可以在线搜索并且快速点歌歌曲信息齐全支持直接回复点歌。命令nem。"

View File

@ -190,6 +190,7 @@ async def nem(context):
ccimported = False
await bot.send_message(context.chat_id, '(`PyCryptodome`支持库未安装,音乐曲库/音质受限\n请使用 `-sh` `pip3` `install` `pycryptodome` 安装或自行ssh安装)')
name = info['title'].replace('/', " ") + ".mp3"
name = name.encode('utf-8').decode('utf-8')
if ccimported: # 尝试使用高清音质下载
songid = str(info['id'])
@ -333,7 +334,7 @@ async def nem(context):
try:
content = requests.get(
url=real_url, headers=self.headers).content
with open(file, 'wb', encoding='utf8') as fp:
with open(file, 'wb') as fp:
fp.write(content)
except:
print('服务器连接出错')
@ -372,7 +373,7 @@ async def nem(context):
';', ', ') + " - " + "**" + info['title'] + "**"
if ccimported is False:
with open(name, 'wb', encoding='utf8') as f:
with open(name, 'wb') as f:
f.write(music.content)
if (path.getsize(name) / 1024) < 100:
remove(name)