@@ -275,9 +275,9 @@ async def analyze_group_daily(
275275 f"[AstrBot QQ群日常分析总结插件] ⚠️ 图片报告生成失败,以下是文本版本:\n \n { text_report } "
276276 )
277277 elif output_format == "pdf" :
278- if not self .config_manager .pyppeteer_available :
278+ if not self .config_manager .playwright_available :
279279 yield event .plain_result (
280- "❌ PDF 功能不可用,请使用 /安装PDF 命令安装 pyppeteer==1.0.2 "
280+ "❌ PDF 功能不可用,请使用 /安装PDF 命令安装依赖 "
281281 )
282282 return
283283
@@ -342,8 +342,8 @@ async def set_output_format(
342342 current_format = self .config_manager .get_output_format ()
343343 pdf_status = (
344344 "✅"
345- if self .config_manager .pyppeteer_available
346- else "❌ (需安装 pyppeteer )"
345+ if self .config_manager .playwright_available
346+ else "❌ (需安装 Playwright )"
347347 )
348348 yield event .plain_result (f"""📊 当前输出格式: { current_format }
349349
@@ -360,10 +360,8 @@ async def set_output_format(
360360 yield event .plain_result ("❌ 无效的格式类型,支持: image, text, pdf" )
361361 return
362362
363- if format_type == "pdf" and not self .config_manager .pyppeteer_available :
364- yield event .plain_result (
365- "❌ PDF 格式不可用,请使用 /安装PDF 命令安装 pyppeteer==1.0.2"
366- )
363+ if format_type == "pdf" and not self .config_manager .playwright_available :
364+ yield event .plain_result ("❌ PDF 格式不可用,请使用 /安装PDF 命令安装依赖" )
367365 return
368366
369367 self .config_manager .set_output_format (format_type )
@@ -540,14 +538,10 @@ async def install_pdf_deps(self, event: AiocqhttpMessageEvent):
540538 yield event .plain_result ("🔄 开始安装 PDF 功能依赖,请稍候..." )
541539
542540 try :
543- # 安装 pyppeteer
544- result = await PDFInstaller .install_pyppeteer (self .config_manager )
541+ # 安装 playwright (内部已包含浏览器内核安装逻辑)
542+ result = await PDFInstaller .install_playwright (self .config_manager )
545543 yield event .plain_result (result )
546544
547- # 提供系统依赖安装指导
548- system_deps_result = await PDFInstaller .install_system_deps ()
549- yield event .plain_result (system_deps_result )
550-
551545 except Exception as e :
552546 logger .error (f"安装 PDF 依赖失败: { e } " , exc_info = True )
553547 yield event .plain_result (f"❌ 安装过程中出现错误: { str (e )} " )
0 commit comments