返回 Social Auto Upload
test_alipay_upload.py
根目录 / examples / test_alipay_upload.py
1 # -*- coding: utf-8 -*-
2 """测试支付宝生活号上传:使用已保存的 cookie 上传并发布一个视频。"""
3 import asyncio
4 import sys
5 from datetime import datetime
6 from pathlib import Path
7
8 sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
9
10 from uploader.alipay_uploader.main import AlipayVideo
11
12
13 async def main():
14 base = Path(__file__).resolve().parents[1]
15 video_path = Path(r"D:\video-moving\assets\outro\outro_horizontal.mp4")
16 account_file = base / "cookies" / "alipay_uploader" / "account.json"
17
18 app = AlipayVideo(
19 title="测试发布标题",
20 file_path=str(video_path),
21 tags=["测试", "自动化"],
22 account_file=str(account_file),
23 desc="测试描述",
24 thumbnail_path=r"C:\Users\admin\Downloads\ScreenShot_2026-08-04_170159_630.png",
25 collection_name="",
26 headless=False,
27 )
28 await app.main()
29
30
31 if __name__ == "__main__":
32 asyncio.run(main())
33
33 lines PYTHON