diff --git a/autocaption.py b/autocaption.py index 6be8b15..95d5d18 100644 --- a/autocaption.py +++ b/autocaption.py @@ -2,7 +2,7 @@ from pagermaid import version from pagermaid.listener import listener from telethon.tl.custom.message import Message from telethon.tl.types import MessageMediaDocument, DocumentAttributeFilename, DocumentAttributeImageSize, \ - DocumentAttributeAudio + DocumentAttributeAudio, DocumentAttributeSticker, DocumentAttributeVideo, DocumentAttributeAnimated def unit_convert(byte): @@ -56,6 +56,19 @@ async def auto_caption_file(context: Message): text += f"`音乐时长:{duration_convert(i.duration)}`\n" else: text += f"`语音时长:{duration_convert(i.duration)}`\n" + # 视频时长、尺寸 + if isinstance(i, DocumentAttributeVideo): + text += f"`视频尺寸:{i.w}x{i.h}`\n" + text += f"`视频时长:{duration_convert(i.duration)}`\n" + text += f"`应用内播放:{'是' if i.supports_streaming else '否'}`\n" + # 过滤○视频 + if i.round_message: + return + # 过滤 sticker + if isinstance(i, DocumentAttributeSticker): + return + if isinstance(i, DocumentAttributeAnimated): + return # 文件类型 text += f"`文件类型:{context.media.document.mime_type}`\n" # 文件大小 diff --git a/list.json b/list.json index bc78243..9e7b909 100644 --- a/list.json +++ b/list.json @@ -852,10 +852,10 @@ }, { "name": "autocaption", - "version": "1.001", + "version": "1.01", "section": "chat", "maintainer": "xtaodada", - "size": "2.2 kb", + "size": "2.83 kb", "supported": true, "des-short": "自动获取所发送文件的信息。", "des": "自动获取所发送文件的信息。"