Files
nanocode/xhs_trending_automation/scripts/shared_utils.py
T
Ubuntu 32b43f85bd a
2026-07-03 16:58:28 +08:00

35 lines
933 B
Python

#!/usr/bin/env python3
"""
共享工具模块
负责导入IT资讯自动化项目的公共模块
"""
import sys
import os
# 将IT资讯项目路径加入Python路径
IT_AUTO_PATH = "/home/ubuntu/nanocode/it_automation_enhanced/scripts"
if IT_AUTO_PATH not in sys.path:
sys.path.insert(0, IT_AUTO_PATH)
def get_xiaohongshu_publisher():
"""
获取小红书发布器(共享模块)
"""
try:
from xiaohongshu_multi_image import XiaohongshuMultiImagePublisher
return XiaohongshuMultiImagePublisher
except ImportError as e:
raise ImportError(f"无法加载共享发布模块: {e}")
def get_anti_ai_humanizer():
"""
获取去AI化处理器(共享模块)
"""
try:
sys.path.insert(0, "/home/ubuntu/.nanobot/workspace/skills/anti-ai-detector")
from humanize import humanize_text
return humanize_text
except ImportError:
return None