测试xml视频内容

This commit is contained in:
liuwei
2025-08-15 15:16:24 +08:00
parent d2a51cd982
commit 67520decfe
3 changed files with 47 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
enable = true enable = true
# 发送模式: card(发送卡片) 或 file(下载并发送文件) # 发送模式: card(发送卡片) 或 file(下载并发送文件)
download_mode = "file" download_mode = "card"
# Http代理设置用于获取真实链接发送卡片如果家里有ipv6可以设置为空 # Http代理设置用于获取真实链接发送卡片如果家里有ipv6可以设置为空
# 格式: http://用户名:密码@代理地址:代理端口 # 格式: http://用户名:密码@代理地址:代理端口

View File

@@ -13,7 +13,7 @@ from base.plugin_common.plugin_interface import PluginStatus
from utils.decorator.plugin_decorators import plugin_stats_decorator from utils.decorator.plugin_decorators import plugin_stats_decorator
from utils.robot_cmd.robot_command import Feature, PermissionStatus, GroupBotManager from utils.robot_cmd.robot_command import Feature, PermissionStatus, GroupBotManager
from wechat_ipad import WechatAPIClient from wechat_ipad import WechatAPIClient
from wechat_ipad.models.appmsg_xml import LINK_XML_NORMAL from wechat_ipad.models.appmsg_xml import LINK_XML_NORMAL, VIDEO_XML_MESSAGE
class DouyinParserError(Exception): class DouyinParserError(Exception):
@@ -162,8 +162,7 @@ class DouyinParserPlugin(MessagePluginInterface):
return False, "下载视频失败" return False, "下载视频失败"
else: else:
# 发送卡片 # 发送卡片
xml_content = f"{LINK_XML_NORMAL}".format(title=title, xml_content = f"{VIDEO_XML_MESSAGE}".format(title=title,
des=author,
url=video_url, url=video_url,
thumburl=cover thumburl=cover
) )

View File

@@ -140,3 +140,47 @@ LINK_XML_NORMAL = """
</appinfo> </appinfo>
<commenturl></commenturl> <commenturl></commenturl>
""" """
VIDEO_XML_MESSAGE = """
<appmsg appid="" sdkver="1">
<title>{title}</title>
<des>点击观看无水印视频</des>
<action />
<type>5</type>
<showtype>0</showtype>
<soundtype>0</soundtype>
<mediatagname />
<messageext />
<messageaction />
<content />
<contentattr>0</contentattr>
<url>{url}</url>
<lowurl />
<dataurl />
<lowdataurl />
<songalbumurl />
<songlyric />
<appattach>
<totallen>0</totallen>
<attachid />
<emoticonmd5 />
<fileext />
<cdnthumbaeskey />
<aeskey />
</appattach>
<extinfo />
<sourceusername />
<sourcedisplayname />
<thumburl>{thumburl}</thumburl>
<md5 />
<statextstr />
<directshare>0</directshare>
</appmsg>
<fromusername>wxid_qf7oo9svlxb212</fromusername>
<scene>0</scene>
<appinfo>
<version>1</version>
<appname></appname>
</appinfo>
<commenturl></commenturl>
"""