diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index d47237c..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,114 +0,0 @@ -## Project Overview - -This project, `social-auto-upload`, is a powerful automation tool designed to help content creators and operators efficiently publish video content to multiple domestic and international mainstream social media platforms in one click. The project implements video upload, scheduled release and other functions for platforms such as `Douyin`, `Bilibili`, `Xiaohongshu`, `Kuaishou`, `WeChat Channel`, `Baijiahao` and `TikTok`. - -The project consists of a Python backend and a Vue.js frontend. - -**Backend:** - -* Framework: Flask -* Core Functionality: - * Handles file uploads and management. - * Interacts with a SQLite database to store information about files and user accounts. - * Uses `playwright` for browser automation to interact with social media platforms. - * Provides a RESTful API for the frontend to consume. - * Uses Server-Sent Events (SSE) for real-time communication with the frontend during the login process. - -**Frontend:** - -* Framework: Vue.js -* Build Tool: Vite -* UI Library: Element Plus -* State Management: Pinia -* Routing: Vue Router -* Core Functionality: - * Provides a web interface for managing social media accounts, video files, and publishing videos. - * Communicates with the backend via a RESTful API. - -**Command-line Interface:** - -The project also provides a command-line interface (CLI) for users who prefer to work from the terminal. For new Douyin CLI work, prefer the `sau douyin ...` entrypoint over legacy example scripts. - -* `login`: To log in to the Douyin uploader account. -* `check`: To verify whether the saved Douyin cookie is still valid. -* `upload`: To upload one video file with explicit metadata flags. - -## Building and Running - -### Backend - -1. **Install dependencies:** - ```bash - pip install -r requirements.txt - ``` - -2. **Install Playwright browser drivers:** - ```bash - playwright install chromium - ``` - -3. **Initialize the database:** - ```bash - python db/createTable.py - ``` - -4. **Run the backend server:** - ```bash - python sau_backend.py - ``` - The backend server will start on `http://localhost:5409`. - -### Frontend - -1. **Navigate to the frontend directory:** - ```bash - cd sau_frontend - ``` - -2. **Install dependencies:** - ```bash - npm install - ``` - -3. **Run the development server:** - ```bash - npm run dev - ``` - The frontend development server will start on `http://localhost:5173`. - -### Command-line Interface - -To use the CLI, you can run the `cli_main.py` script with the appropriate arguments. - -**Login:** - -```bash -sau douyin login --account -``` - -**Check:** - -```bash -sau douyin check --account -``` - -**Upload:** - -```bash -sau douyin upload --account --file --title [--tags tag1,tag2] [--schedule YYYY-MM-DD HH:MM] -``` - -**Install bundled skill:** - -```bash -sau skill install -``` - -## Development Conventions - -* The backend code is located in the root directory and the `myUtils` and `uploader` directories. -* The frontend code is located in the `sau_frontend` directory. -* The project uses a SQLite database for data storage. The database file is located at `db/database.db`. -* The `conf.example.py` file should be copied to `conf.py` and configured with the appropriate settings. -* The `requirements.txt` file lists the Python dependencies. -* The `package.json` file in the `sau_frontend` directory lists the frontend dependencies. diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index a074104..9e71ae7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # social-auto-upload `social-auto-upload` 是一个强大的自动化工具,旨在帮助内容创作者和运营者高效地将视频内容一键发布到多个国内外主流社交媒体平台。 -项目实现了对 `抖音`、`Bilibili`、`小红书`、`快手`、`视频号`、`百家号`、`TikTok` 以及 `YouTube` 等平台的视频上传、定时发布等功能。 +项目实现了对 `抖音`、`Bilibili`、`小红书`、`快手`、`视频号`、`百家号`、`支付宝生活号`、`TikTok` 以及 `YouTube` 等平台的视频上传、定时发布等功能。 结合各平台 `uploader` 模块,您可以轻松配置和扩展支持的平台,并通过示例脚本快速上手。 <img src="media/show/tkupload.gif" alt="tiktok show" width="800"/> @@ -76,8 +76,9 @@ | Bilibili | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | 运行时自动准备 `biliup` | | 小红书(浏览器版) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 浏览器自动化,CLI/Skill 已接入 | | 快手 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 浏览器自动化,CLI/Skill 初版已接入 | -| 视频号 | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | 对应 `tencent_uploader` | -| 百家号 | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | 浏览器自动化 | +| 视频号 | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | 浏览器自动化,对应 `tencent_uploader` | +| 百家号 | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | 浏览器自动化 | +| 支付宝生活号 | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | 浏览器自动化,支持生活号视频 | | TikTok | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | 当前示例走 Chrome 版实现 | | YouTube | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | 浏览器自动化(Studio),支持加入播放列表/可见性 | @@ -166,7 +167,7 @@ Web 端相关代码仍然保留,但已经不是当前主线,不保证可直 ### 方式 1:使用 CLI -当前抖音、快手、小红书、Bilibili 已经接入 CLI: +当前抖音、快手、小红书、Bilibili、视频号、百家号和支付宝生活号已经接入 CLI: ```bash sau douyin login --account <account_name> @@ -188,6 +189,18 @@ sau bilibili login --account <account_name> sau bilibili check --account <account_name> sau bilibili upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tid 249 +sau tencent login --account <account_name> +sau tencent check --account <account_name> +sau tencent upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tags tag1,tag2 + +sau baijiahao login --account <account_name> +sau baijiahao check --account <account_name> +sau baijiahao upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tags tag1,tag2 + +sau alipay login --account <account_name> +sau alipay check --account <account_name> +sau alipay upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tags tag1,tag2 + sau youtube login --account <account_name> sau youtube check --account <account_name> sau youtube upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tags tag1,tag2 --playlist "我的系列" --visibility public @@ -228,6 +241,8 @@ sau youtube upload-video --account <account_name> --file videos/demo.mp4 --title - `examples/upload_to_kuaishou.py` - `examples/upload_video_to_tencent.py` - `examples/upload_video_to_baijiahao.py` +- `examples/get_alipay_cookie.py` +- `examples/test_alipay_upload.py` - `examples/upload_video_to_tiktok.py` - `examples/upload_video_to_xiaohongshu.py` diff --git a/docs/CLI.md b/docs/CLI.md index c613129..5eb21e8 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -6,6 +6,10 @@ - `kuaishou` - `xiaohongshu` - `bilibili` +- `tencent` +- `baijiahao` +- `alipay` +- `youtube` 实现说明: @@ -17,6 +21,8 @@ - `skills/xiaohongshu-upload/` - `skills/bilibili-upload/` +视频号、百家号和支付宝生活号目前只有 CLI 入口,暂未提供对应的 skill。 + ## 安装 CLI 入口 如果你希望直接使用 `sau` 命令,而不是手动执行 `python sau_cli.py`,先在项目根目录安装一次: @@ -32,6 +38,10 @@ sau douyin --help sau kuaishou --help sau xiaohongshu --help sau bilibili --help +sau tencent --help +sau baijiahao --help +sau alipay --help +sau youtube --help ``` ## 安装 patchright 浏览器 @@ -103,17 +113,64 @@ sau bilibili upload-video --account <account_name> --file videos/demo.mp4 --titl - 如果上游 GitHub Release 有更新,运行时会先自动更新 - `sau bilibili login --account <name>` 建议由用户自己在本地真实终端里执行;如果终端里的二维码显示不完整,可直接打开当前目录下的 `qrcode.png` 扫码 +## 视频号 CLI 子命令 + +```bash +sau tencent login --account <account_name> +sau tencent check --account <account_name> +sau tencent upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tags 视频号,测试 +``` + +视频号支持定时发布、草稿、合集和双比例封面: + +```bash +sau tencent upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --schedule "2026-03-24 21:30" --thumbnail-landscape covers/landscape.png --thumbnail-portrait covers/portrait.png --collection "我的合集" +sau tencent upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --draft +``` + +视频号登录和上传依赖浏览器中的登录态。无头模式下如果需要扫码,CLI 会生成临时二维码;需要人工查看页面时可以加 `--headed`。 + +## 百家号 CLI 子命令 + +```bash +sau baijiahao login --account <account_name> +sau baijiahao check --account <account_name> +sau baijiahao upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tags 百家号,测试 +``` + +百家号当前支持登录、账号检查和视频上传;支持 `--thumbnail` 与 `--collection`,暂不支持 `--schedule`。上传前需要先完成百度账号登录并保存账号文件。 + +## 支付宝生活号 CLI 子命令 + +```bash +sau alipay login --account <account_name> +sau alipay check --account <account_name> +sau alipay upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tags 生活号,测试 +``` + +支付宝生活号当前支持登录、账号检查和视频上传;支持 `--thumbnail` 与 `--collection`,暂不支持图文上传和 `--schedule`。首次使用前需要在支付宝内容创作后台完成登录,并确认账号已开通生活号内容创作权限。 + +## YouTube CLI 子命令 + +```bash +sau youtube login --account <account_name> +sau youtube check --account <account_name> +sau youtube upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tags tag1,tag2 --playlist "我的系列" --visibility public +``` + +YouTube 登录需要在浏览器中完成 Google 账号登录,不使用二维码。`--visibility` 可选 `public`、`unlisted` 或 `private`,`--playlist` 可选。 + ## 登录二维码说明 -- 抖音、快手、小红书登录过程中,CLI / uploader 可能会生成临时二维码图片 +- 抖音、快手、小红书、视频号、百家号和支付宝生活号登录过程中,CLI / uploader 可能会生成临时二维码图片 - 对普通用户来说,可以直接打开该图片扫码 - 对可操作本地文件的 agent 来说,不要只把图片路径告诉用户 - 这类二维码图片本身就是给用户扫码的,agent 应优先直接展示/发送本地图片给用户 -- Bilibili 当前不走这套本地二维码图片托管链路,登录按上面的 Bilibili CLI 说明处理即可 +- Bilibili 和 YouTube 当前不走这套本地二维码图片托管链路,登录按上面的平台说明处理即可 ## 定时发布 -抖音、快手、小红书的图文和视频上传,以及 Bilibili 的视频上传都支持 `--schedule`。只要传了 `--schedule`,CLI 就会自动切换到对应平台的定时发布策略;不传则默认立即发布。 +抖音、快手、小红书、视频号的图文或视频上传,以及 Bilibili 的视频上传支持 `--schedule`。只要传了 `--schedule`,CLI 就会自动切换到对应平台的定时发布策略;不传则默认立即发布。百家号和支付宝生活号当前不支持 `--schedule`。 ```bash sau douyin upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --schedule "2026-03-24 21:30" @@ -123,6 +180,7 @@ sau kuaishou upload-note --account <account_name> --images videos/1.png videos/2 sau xiaohongshu upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --schedule "2026-03-24 21:30" sau xiaohongshu upload-note --account <account_name> --images videos/1.png videos/2.png videos/3.png --title "图文标题" --note "图文示例" --schedule "2026-03-24 21:30" sau bilibili upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --tid 249 --schedule "2026-03-24 21:30" +sau tencent upload-video --account <account_name> --file videos/demo.mp4 --title "示例标题" --desc "示例简介" --schedule "2026-03-24 21:30" ``` ## 运行时参数 @@ -164,6 +222,8 @@ CLI 将 `debug` 和 `headless` 拆成了两个独立维度: - `--thumbnail-portrait`: 3:4 竖版封面 - `--thumbnail`: 兼容旧参数,等同于 3:4 竖版封面 +视频号、百家号和支付宝生活号支持使用 `--collection` 指定已有合集;百家号和支付宝生活号还支持 `--thumbnail` 指定封面图。 + 抖音额外支持: ```bash