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