返回 Social Auto Upload
CLAUDE.md
根目录 / CLAUDE.md
1 ## Project Overview
2
3 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`.
4
5 The project consists of a Python backend and a Vue.js frontend.
6
7 **Backend:**
8
9 * Framework: Flask
10 * Core Functionality:
11 * Handles file uploads and management.
12 * Interacts with a SQLite database to store information about files and user accounts.
13 * Uses `playwright` for browser automation to interact with social media platforms.
14 * Provides a RESTful API for the frontend to consume.
15 * Uses Server-Sent Events (SSE) for real-time communication with the frontend during the login process.
16
17 **Frontend:**
18
19 * Framework: Vue.js
20 * Build Tool: Vite
21 * UI Library: Element Plus
22 * State Management: Pinia
23 * Routing: Vue Router
24 * Core Functionality:
25 * Provides a web interface for managing social media accounts, video files, and publishing videos.
26 * Communicates with the backend via a RESTful API.
27
28 **Command-line Interface:**
29
30 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.
31
32 * `login`: To log in to the Douyin uploader account.
33 * `check`: To verify whether the saved Douyin cookie is still valid.
34 * `upload`: To upload one video file with explicit metadata flags.
35
36 ## Building and Running
37
38 ### Backend
39
40 1. **Install dependencies:**
41 ```bash
42 pip install -r requirements.txt
43 ```
44
45 2. **Install Playwright browser drivers:**
46 ```bash
47 playwright install chromium
48 ```
49
50 3. **Initialize the database:**
51 ```bash
52 python db/createTable.py
53 ```
54
55 4. **Run the backend server:**
56 ```bash
57 python sau_backend.py
58 ```
59 The backend server will start on `http://localhost:5409`.
60
61 ### Frontend
62
63 1. **Navigate to the frontend directory:**
64 ```bash
65 cd sau_frontend
66 ```
67
68 2. **Install dependencies:**
69 ```bash
70 npm install
71 ```
72
73 3. **Run the development server:**
74 ```bash
75 npm run dev
76 ```
77 The frontend development server will start on `http://localhost:5173`.
78
79 ### Command-line Interface
80
81 To use the CLI, you can run the `cli_main.py` script with the appropriate arguments.
82
83 **Login:**
84
85 ```bash
86 sau douyin login --account <account_name>
87 ```
88
89 **Check:**
90
91 ```bash
92 sau douyin check --account <account_name>
93 ```
94
95 **Upload:**
96
97 ```bash
98 sau douyin upload --account <account_name> --file <video_file> --title <title> [--tags tag1,tag2] [--schedule YYYY-MM-DD HH:MM]
99 ```
100
101 **Install bundled skill:**
102
103 ```bash
104 sau skill install
105 ```
106
107 ## Development Conventions
108
109 * The backend code is located in the root directory and the `myUtils` and `uploader` directories.
110 * The frontend code is located in the `sau_frontend` directory.
111 * The project uses a SQLite database for data storage. The database file is located at `db/database.db`.
112 * The `conf.example.py` file should be copied to `conf.py` and configured with the appropriate settings.
113 * The `requirements.txt` file lists the Python dependencies.
114 * The `package.json` file in the `sau_frontend` directory lists the frontend dependencies.
115
115 lines MARKDOWN