How dreammis/social-auto-upload works
Based on our analysis of the file tree and README, this project is a Python‐based automated video uploader that targets multiple social media platforms. Its purpose is to prepare videos (along with meta information), manage login and cookie retrieval, and handle the upload process for platforms such as douyin, tencent (视频号), bilibili, xhs (小红书), tiktok, and fast platforms like kuaishou. The project offers both CLI usage and example scripts that users can integrate into their own workflows.
Main Components
• CLI Interface: Represented by cli_main.py which acts as the entry point. It accepts the platform, account name, and action (upload, login, watch) parameters.
• Configuration Module: Includes conf.py and parts of utility modules (like utils/constant.py) that provide settings such as LOCAL_CHROME_PATH.
• Uploader Modules: There is a dedicated uploader folder with subdirectories for each platform (e.g., bilibili_uploader, douyin_uploader, ks_uploader, tencent_uploader, tk_uploader, xhs_uploader). Each module contains its main.py and additional scripts for handling login (cookie retrieval) and video upload.
• Examples: The examples directory contains sample scripts that demonstrate how to get cookies and upload videos. These scripts act as a practical guide for users or developers integrating the functionality.
• Utility Library: The utils folder provides shared functionality (e.g., basic functionality for social media operations, logging, file handling) that is used across different uploader modules.
• Video Management: The videos folder stores sample media files (video and text metadata). This represents the source content that is uploaded by the system.
• Media Resources: The media folder (and its subfolders) holds images and other static resources used in the README or potentially in the user interface (show illustrations, GIFs).
Relationships and Interactions
• The CLI (cli_main.py) is the controller that parses user input and routes commands to the appropriate module.
• Each uploader module internally uses browser automation (via playwright) to simulate the upload process and even to get cookies.
• Configuration settings from conf.py and parameter files (like tk_config.py for tiktok) are used to ensure compatibility (e.g., using a local chrome executable) and manage scheduling (e.g., cron or delayed uploads).
• The utility functions in the utils folder provide cross-cutting services such as logging and file operations, which support operations in different uploader modules.
• The examples directory is used to demonstrate how the modules can be used directly outside of a larger integrated system.
Important Architectural Patterns and Technologies
• Modular Design: Uploader modules are separated by platform, which simplifies adding or updating a specific social-media integration.
• Separation of Concerns: Distinct directories handle CLI, configuration, uploader logic, utility functions, and examples. This makes the codebase easier to maintain.
• External Dependencies: The use of playwright (for browser automation) and external binaries (e.g., biliup.exe for bilibili) are key technological choices.
• Scheduling and Automation: The project supports scheduled uploads (utilizing cron-like timing) and manual immediate uploads.
• Extensibility: The system is designed so that users can easily integrate additional uploaders or extend functionality using the provided examples and utility libraries.
Specific Elements
• User inputs (platform, account, action) flowing from CLI to the corresponding uploader module.
• Data flow between configuration files and uploader modules.
• Command-line components versus background modules.
• Platform-specific logic versus shared utilities.
• Notes for key processes like "Cookie Retrieval", "Video Upload", and "Scheduled Release".