feature:抖音分享链接转视频

This commit is contained in:
liuwei
2025-03-11 11:17:42 +08:00
parent b8a02580f2
commit 5af63f2c0e

View File

@@ -129,13 +129,13 @@ class DouyinParser:
if not video_url: if not video_url:
raise DouyinParserError("无法获取视频地址") raise DouyinParserError("无法获取视频地址")
self.send_xml_video(message, title, author, video_url) self.send_xml_video(message, title, author, video_url,cover)
except Exception as e: except Exception as e:
self.LOG.error("[抖音] 解析过程发生未知错误: %s\n%s", str(e), traceback.format_exc()) self.LOG.error("[抖音] 解析过程发生未知错误: %s\n%s", str(e), traceback.format_exc())
raise DouyinParserError(f"未知错误: {str(e)}") raise DouyinParserError(f"未知错误: {str(e)}")
return return
def send_xml_video(self, message: WxMsg, title, author, video_url): def send_xml_video(self, message: WxMsg, title, author, video_url,cover):
video_title = f"{title[:30]} - {author[:10]}" if author else title[:40], video_title = f"{title[:30]} - {author[:10]}" if author else title[:40],
xml_message = f""" xml_message = f"""
@@ -153,7 +153,7 @@ class DouyinParser:
<lowurl /> <lowurl />
<lowdataurl /> <lowdataurl />
<recorditem /> <recorditem />
<thumburl></thumburl> <thumburl>{cover}</thumburl>
<messageaction /> <messageaction />
<laninfo /> <laninfo />
<extinfo /> <extinfo />