feat(alipay): add Alipay life account video uploader

- New uploader/alipay_uploader module: QR-code cookie login, upload page
  flow, title/desc/tags fill, thumbnail, collection and publish
- sau_cli: add 'alipay login/check/upload-video' subcommands
- examples: get_alipay_cookie.py and test_alipay_upload.py
- utils/log.py: register alipay logger
- utils/login_qrcode.py: robust QR decode on non-ASCII Windows paths
  (numpy imdecode with cv2.imread fallback)
This commit is contained in:
suihf
2026-08-13 09:55:22 +08:00
parent 008e4ff66a
commit 0625f9b13b
7 changed files with 875 additions and 5 deletions
+18
View File
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
"""获取支付宝生活号 cookie:打开浏览器扫码登录后自动保存到 cookies/alipay_uploader/account.json"""
import asyncio
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from uploader.alipay_uploader.main import alipay_cookie_gen
async def main():
account_file = Path(__file__).resolve().parents[1] / "cookies" / "alipay_uploader" / "account.json"
await alipay_cookie_gen(str(account_file))
if __name__ == "__main__":
asyncio.run(main())
+32
View File
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
"""测试支付宝生活号上传:使用已保存的 cookie 上传并发布一个视频。"""
import asyncio
import sys
from datetime import datetime
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from uploader.alipay_uploader.main import AlipayVideo
async def main():
base = Path(__file__).resolve().parents[1]
video_path = Path(r"D:\video-moving\assets\outro\outro_horizontal.mp4")
account_file = base / "cookies" / "alipay_uploader" / "account.json"
app = AlipayVideo(
title="测试发布标题",
file_path=str(video_path),
tags=["测试", "自动化"],
account_file=str(account_file),
desc="测试描述",
thumbnail_path=r"C:\Users\admin\Downloads\ScreenShot_2026-08-04_170159_630.png",
collection_name="",
headless=False,
)
await app.main()
if __name__ == "__main__":
asyncio.run(main())