feature:抖音分享链接转视频
This commit is contained in:
@@ -125,6 +125,7 @@ class DouyinParser:
|
||||
video_url = video_info.get('video', '')
|
||||
title = video_info.get('title', '无标题')
|
||||
author = video_info.get('name', '未知作者')
|
||||
cover = video_info.get('cover', '')
|
||||
|
||||
if not video_url:
|
||||
raise DouyinParserError("无法获取视频地址")
|
||||
@@ -136,11 +137,12 @@ class DouyinParser:
|
||||
|
||||
def send_xml_video(self, message: WxMsg, title, author, video_url):
|
||||
|
||||
video_title = f"{title[:30]} - {author[:10]}" if author else title[:40],
|
||||
xml_message = f"""
|
||||
<?xml version="1.0"?>
|
||||
<msg>
|
||||
<appmsg appid="" sdkver="1">
|
||||
<title>{title} @{author}</title>
|
||||
<title>{video_title}</title>
|
||||
<des>点击观看无水印视频</des>
|
||||
<action>view</action>
|
||||
<type>5</type>
|
||||
@@ -193,7 +195,7 @@ class DouyinParser:
|
||||
|
||||
data = self.wcf.query_sql('MSG0.db', "SELECT * FROM MSG where type = 49 limit 1")
|
||||
self.wcf.query_sql('MSG0.db',
|
||||
f"""UPDATE MSG SET CompressContent = x'{compressed_data}', BytesExtra=x'', type=49, SubType=5,
|
||||
f"""UPDATE MSG SET CompressContent = x'{compressed_data}', BytesExtra=x'', type=49, SubType=3,
|
||||
IsSender=0, TalkerId=2 WHERE MsgSvrID={data[0]['MsgSvrID']}"""
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user