mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 03:19:17 +00:00
修复了歌曲TG预览时显示时长为0的bug
This commit is contained in:
parent
d3a2e24189
commit
432ac7db3d
@ -282,10 +282,10 @@
|
||||
},
|
||||
{
|
||||
"name": "neteasemusic",
|
||||
"version": "2.7",
|
||||
"version": "2.8",
|
||||
"section": "daily",
|
||||
"maintainer": "TNTcraftHIM",
|
||||
"size": "24.3 kb",
|
||||
"size": "25.0 kb",
|
||||
"supported": true,
|
||||
"des-short": "网易云点歌",
|
||||
"des": "可以在线搜索并且快速点歌,歌曲信息齐全,支持直接回复点歌。命令:nem。"
|
||||
|
@ -383,14 +383,16 @@ async def nem(context):
|
||||
' <strong>这里</strong> ' + '</a>' + '前往网页版收听'
|
||||
await bot.send_message(context.chat_id, f"<strong>【{info['title']}】</strong>\n" + "歌曲获取失败,资源获取可能受限,你可以再次尝试。\n" + res, parse_mode='html', link_preview=True)
|
||||
return
|
||||
duration=0
|
||||
if imported is True:
|
||||
await context.edit(f"{title}信息导入中 . . .")
|
||||
try:
|
||||
imagedata = requests.get(
|
||||
info['albumpic'], headers=headers).content
|
||||
except:
|
||||
await bot.send_message(context.chat_id, '唔 ~ 封面好像获取失败了呢,不要在意不要在意 ~ ')
|
||||
await bot.send_message(context.chat_id, '唔 封面好像获取失败了呢,不要在意不要在意 ~ ')
|
||||
tag = eyed3.load(name)
|
||||
duration = int(tag.info.time_secs)
|
||||
tag.initTag()
|
||||
tag = tag.tag
|
||||
tag.artist = info['artist']
|
||||
@ -417,7 +419,7 @@ async def nem(context):
|
||||
link_preview=False,
|
||||
force_document=False,
|
||||
attributes=(DocumentAttributeAudio(
|
||||
0, False, info['title'], info['artist']),)
|
||||
duration, False, info['title'], info['artist']),)
|
||||
)
|
||||
try:
|
||||
if reply.sender.is_self:
|
||||
|
Loading…
Reference in New Issue
Block a user