测试抖音处理

This commit is contained in:
liuwei
2025-08-13 10:13:01 +08:00
parent eb5b6ebe75
commit 36267a4974

View File

@@ -135,7 +135,7 @@ class DouyinParserPlugin(MessagePluginInterface):
# 解析抖音视频
video_info = self._parse_douyin(original_url)
if not video_info:
print(f"❌无法解析抖音视频信息")
self.LOG.error(f"❌无法解析抖音视频信息")
return False, "解析失败"
video_url = video_info.get('url', '')
@@ -144,7 +144,7 @@ class DouyinParserPlugin(MessagePluginInterface):
cover = video_info.get('cover', '')
if not video_url:
print(f"❌无法获取视频地址")
self.LOG.error(f"❌无法获取视频地址")
return False, "获取视频地址失败"
# 根据模式选择发送方式
@@ -158,7 +158,7 @@ class DouyinParserPlugin(MessagePluginInterface):
await self.bot.send_video_message((roomid if roomid else sender), Path(mp4_path))
return True, "发送视频文件成功"
else:
print(f"❌下载视频失败")
self.LOG.error(f"❌下载视频失败")
return False, "下载视频失败"
else:
# 发送卡片
@@ -172,11 +172,11 @@ class DouyinParserPlugin(MessagePluginInterface):
except DouyinParserError as e:
self.LOG.error(f"抖音解析错误: {e}")
print(f"❌抖音解析失败: {str(e)}")
self.LOG.error(f"❌抖音解析失败: {str(e)}")
return False, f"解析错误: {e}"
except Exception as e:
self.LOG.error(f"处理抖音链接出错: {e}\n{traceback.format_exc()}")
print(f"❌处理抖音链接出错: {str(e)}")
self.LOG.error(f"❌处理抖音链接出错: {str(e)}")
return False, f"处理出错: {e}"
def _clean_url(self, url: str) -> str: