#!/usr/bin/env python3 """ 测试小红书作品自动分页 - 直接调用 Python API """ import asyncio import sys import json from platforms.xiaohongshu import XiaohongshuPublisher async def main(): if len(sys.argv) < 2: print("用法: python test_xhs_paging.py <账号ID>") print("示例: python test_xhs_paging.py 35") sys.exit(1) account_id = sys.argv[1] # 从 Node.js 数据库读取账号信息 # 这里我们需要手动提供 cookie,或者从数据库读取 # 为了简化,我们先从 Node.js 获取 cookie print(f"测试账号 ID: {account_id}") print("=" * 60) print("注意: 此脚本需要从数据库读取账号的 Cookie") print("建议使用 Node.js 脚本 test-xhs-works-sync.ts 来测试") print("=" * 60) # 实际上,我们应该从 Node.js 获取 cookie # 但为了测试,我们可以直接调用 get_all_works # 这里需要手动提供 cookie JSON 字符串 print("\n请使用 Node.js 脚本 test-xhs-works-sync.ts 来测试") print("它会自动调用 Python API 并显示详细日志") if __name__ == "__main__": asyncio.run(main())