JoeanAmier/KS-Downloader
About
A tool for downloading videos and images from KuaiShou (快手) posts
Productivity & AutomationMeasured star growth
- in 24h
- -1
- in 7 days
- 0
- in 15 days
- +9
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README_EN.md
Original
KS-Downloader
English | 简体中文
🔥 KuaiShou Posts Download Tool: Completely free and open-source, based on curl_cffi module, for downloading KuaiShou video and image files!
📑 Project Features
- ✅ Download KuaiShou posts
- ☑️ Download posts cover images
- ☑️ Download posts music files
- ✅ Auto-skip downloaded files
- ✅ File integrity verification
- ✅ Persistent posts metadata storage
- ✅ Track downloaded posts IDs
- ✅ Resumable downloads
- ✅ Dedicated storage folders
- ✅ Custom filename formats
- ☑️ Browser cookie extraction
- ✅ Author alias configuration
- ✅ Archive posts by author
- ✅ Automatic author nickname updates
- ✅ API integration
- ☑️ Background clipboard monitoring
📸 Screenshots
前往 bilibili 观看演示;前往 YouTube 观看演示
🥣 Usage Guide
🖱 Application Execution
⭐ Mac OS/Windows 10+ users: Download pre-built packages from Releases or Actions. Extract and double-click main to run!
⭐ This project includes GitHub Actions for automatic builds - users can compile latest source code into executables anytime!
⭐ For the automatic building executable files tutorial, please refer to the Build of Executable File Guide section of this document. If you need a more detailed step-by-step tutorial with illustrations, please check out this article!
Note: Due to the macOS platform's executable file main not being code-signed, it will be restricted by system security measures on first run. Please execute the command xattr -cr project_folder_path in the terminal to remove the security flag, after which it can run normally.
Default download path: .\_internal\Volume\Download
Configuration file: .\_internal\Volume\config.yaml
Update Methods
Method 1: Download and extract the files, then copy the old version of the _internal\Volume folder into the new version's _internal folder.
Method 2: Download and extract the files (do not run the program), then copy all files and directly overwrite the old version.
⌨️ Source Code Execution
- Install Python interpreter version not lower than
3.12 - Download the latest source code or the source code released in Releases to your local machine
- Run the
python -m venv venvcommand to create a virtual environment (optional) - Run the
.\venv\Scripts\activate.ps1orvenv\Scripts\activatecommand to activate the virtual environment (optional) - Run the
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txtcommand to install the required modules for the program - Run the
python .\main.pyorpython main.pycommand to start KS-Downloader - Run the
uv sync --no-devcommand to synchronize environment dependencies - Run the
uv run main.pycommand to start KS-Downloader
- Install project dependencies using pip
- Install project dependencies using uv (recommended)
⌨️ Docker Execution
- Obtain Image:
- Method 1: Build using
Dockerfile - Method 2: Pull image via
docker pull joeanamier/ks-downloader - Method 3: Pull image via
docker pull ghcr.io/joeanamier/ks-downloader
- Method 1: Build using
- Create Container:
- TUI Mode:
docker run --name container_name(optional) -p HostPort:5557 -v ks_downloader_volume:/app/Volume -it <image name> - API Mode:
docker run --name container_name(optional) -p HostPort:5557 -v ks_downloader_volume:/app/Volume -it <image name> python main.py api - Run Container:
- Start:
docker start -i [container_name/ID] - Restart:
docker restart -i [container_name/ID]
- Start:
Note: The
<image name> here must be consistent with the image name you used in the first step (joeanamier/ks-downloader or ghcr.io/joeanamier/ks-downloader)
Note: Docker version doesn't support browser cookie reading and clipboard monitoring. Other features remain functional. Please report any anomalies.
🖥 Server Mode
Start: Run the command: python .\main.py api
Stop: Press Ctrl + C to stop the server
Open http://127.0.0.1:5557/docs or http://127.0.0.1:5557/redoc; you will see automatically generated interactive API documentation!
🔗 Supported Links
https://www.kuaishou.com/f/share-codehttps://v.kuaishou.com/share-codehttps://www.kuaishou.com/short-video/postsIDhttps://kuaishou.cn/short-video/postsIDhttps://live.kuaishou.com/u/author-id/postsID
Recommend using share links; Multiple URLs supported (space separated).
🪟 Terminal Recommendation
⭐ Use Windows Terminal (default on Windows 11) for optimal display!
📜 Additional Notes
- Windows requires admin privileges to read Chromium/Chrome/Edge cookies
- The
Browser Cookie Readingfeature relies on a third-party module that has not been updated for a long time and may not properly support the latest browser versions. If the feature malfunctions, please try obtaining the cookies manually - Work data stored in
./Volume/Data/DetailData.dbwhen enabled - Settings and download records in
./Volume/KS-Downloader.db - The project has a built-in request delay mechanism to avoid excessive request frequency. Code location:
./source/tools/sleep.py
⚙️ Configuration File
config.yaml (auto-generated) allows custom settings:
If features malfunction, configure cookies first!
| Parameter | Type | Description | Default |
|---|---|---|---|
| mapping_data | str: str | #Author alias mapping data, format: author ID: author alias |
null |
| work_path | str | Root path for work data/file storage | Project root path/Volume |
| folder_name | str | Storage folder name for posts files | Download |
| name_format | str | #Posts file name format, use spaces to separate fields; Supported fields: 作品类型、作者昵称、作者ID、作品描述、作品ID、发布日期 |
发布日期 作者昵称 作品描述 |
| name_length | int | Posts file name length limit. Text exceeding the limit will be truncated. When setting a large value, please ensure the system supports this length | 128 |
| cookies | str | KuaiShou web interface Cookie (no login required) | Dynamically fetched |
| proxy | str | Set program proxy | null |
| data_record | bool | Save posts data to file (SQLite format) | false |
| max_workers | int | Maximum concurrent download tasks | 4 |
| download_cover(Deactivate) | str | Cover download format (JPEG/WEBP), empty string disables | Empty string |
| download_music(Deactivate) | bool | Download posts music track | false |
| max_retry | int | Max retry attempts on failure (seconds) | 5 |
| timeout | int | Request timeout limit (seconds) | 10 |
| impersonate | str | Browser information, refer to curl_cffi documentation when setting | chrome146 |
| download_chunk | int | Download chunk size in bytes | 2097152 (2 MB) |
| folder_mode | bool | Store files in individual folders (folder matches filename) | false |
| author_archive | bool | #Whether to store each author's posts in separate folders; Folder name format: authorID_authorNickname |
false |
name_format instructions (Currently only supports Chinese values) :
作品ID: Posts ID作品描述: Posts Description作品类型: Posts Type发布时间: Publish Time作者昵称: Author Nickname作者ID: Author ID
When author_archive is set to true, the program will store each author's posts in dedicated folders. If an author's nickname changes, the program automatically updates the nickname portion in existing downloaded filenames!
Additionally, you can configure author aliases through the mapping_data parameter. When an alias is set, the program will use your custom alias instead of the original nickname in filenames!
📦 Build of Executable File Guide
This guide will walk you through forking this repository and executing GitHub Actions to automatically build and package the program based on the latest source code!
Steps to Use
1. Fork the Repository
- Click the Fork button at the top right of the project repository to fork it to your personal GitHub account
- Your forked repository address will look like this:
https://github.com/your-username/this-repo
2. Enable GitHub Actions
- Go to the page of your forked repository
- Click the Settings tab at the top
- Click the Actions tab on the right
- Click the General option
- Under Actions permissions, select Allow all actions and reusable workflows and click the Save button
3. Manually Trigger the Build Process
- In your forked repository, click the Actions tab at the top
- Find the workflow named 构建可执行文件
- Click the Run workflow button on the right:
- Select the master or develop branch
- Click Run workflow
4. Check the Build Progress
- On the Actions page, you can see the execution records of the triggered workflow
- Click on the run record to view detailed logs to check the build progress and status
5. Download the Build Result
- Once the build is complete, go to the corresponding run record page
- In the Artifacts section at the bottom of the page, you will see the built result file
- Click to download and save it to your local machine to get the built program
Notes
Resource Usage:
- GitHub provides free build environments for Actions, with a monthly usage limit (2000 minutes) for free-tier users
Code Modifications:
- You are free to modify the code in your forked repository to customize the build process
- After making changes, you can trigger the build process again to get your customized version
Stay in Sync with the Main Repository:
- If the main repository is updated with new code or workflows, it is recommended that you periodically sync your forked repository to get the latest features and fixes
Frequently Asked Questions
Q1: Why can't I trigger the workflow?
A: Please ensure that you have followed the steps to Enable Actions. Otherwise, GitHub will prevent the workflow from running
Q2: What should I do if the build process fails?
A:
- Check the run logs to understand the cause of the failure
- Ensure there are no syntax errors or dependency issues in the code
- If the problem persists, please open an issue on the Issues page
Q3: Can I directly use the Actions from the main repository?
A: Due to permission restrictions, you cannot directly trigger Actions from the main repository. Please use the forked repository to execute the build process
🌟 Contribution Guidelines
Welcome to contributing to this project! To keep the codebase clean, efficient, and easy to maintain, please read the following guidelines carefully to ensure that your contributions can be accepted and integrated smoothly.
- Before starting development, please pull the latest code from the
developbranch as the basis for your modifications; this helps avoid merge conflicts and ensures your changes are based on the latest state of the project. - If your changes involve multiple unrelated features or issues, please split them into several independent commits or pull requests.
- Each pull request should focus on a single feature or fix as much as possible, to facilitate code review and testing.
- Follow the existing coding style; make sure your code is consistent with the style already present in the project; please use the Ruff tool to maintain code formatting standards.
- Write code that is easy to read; add appropriate annotation to help others understand your intentions.
- Each commit should include a clear and concise commit message describing the changes made. The commit message should follow this format:
<type>: <short description> - When you are ready to submit a pull request, please prioritize submitting them to the
developbranch; this provides maintainers with a buffer zone for additional testing and review before final merging into themasterbranch. - It is recommended to communicate with the author before starting development or when encountering questions to ensure alignment in direction and avoid redundant efforts or unnecessary commits.
Reference materials:
✉️ Contact the Author
- Author's Email:[email protected]
- Author's WeChat: Downloader_Tools
- Discord Community: Click to Join the Community
✨ Other Open Source Projects by the Author:
- DouK-Downloader(抖音、TikTok):https://github.com/JoeanAmier/TikTokDownloader
- XHS-Downloader(小红书、XiaoHongShu、RedNote):https://github.com/JoeanAmier/XHS-Downloader
♥️ Support the Project
If KS-Downloader has been helpful to you, please consider giving it a Star ⭐. Thank you for your support!
| 微信(WeChat) | 支付宝(Alipay) |
|---|---|
![]() |
![]() |
If you are willing, you may consider making a donation to provide additional support for KS-Downloader!
⚠️ Disclaimer
- The user's use of this project is entirely at their own discretion and responsibility. The author assumes no liability for any losses, claims, or risks arising from the user's use of this project.
- The code and functionalities provided by the author of this project are based on current knowledge and technological developments. The author strives to ensure the correctness and security of the code according to existing technical capabilities but does not guarantee that the code is entirely free of errors or defects.
- All third-party libraries, plugins, or services relied upon by this project follow their respective open-source or commercial licenses. Users must review and comply with those license agreements. The author assumes no responsibility for the stability, security, or compliance of third-party components.
- Users must strictly comply with the requirements of the GNU General Public License v3.0 when using this project and properly indicate that the code was used under the GNU General Public License v3.0.
- When using the code and features of this project, users must independently research relevant laws and regulations and ensure their actions are legal and compliant. Any legal liabilities or risks arising from violations of laws and regulations shall be borne solely by the user.
- Users must not use this tool to engage in any activities that infringe intellectual property rights, including but not limited to downloading or distributing copyright-protected content without authorization. The developers do not participate in, support, or endorse any unauthorized acquisition or distribution of illegal content.
- This project assumes no responsibility for the compliance of any data processing activities (including collection, storage, and transmission) conducted by users. Users must comply with relevant laws and regulations and ensure that their processing activities are lawful and proper. Legal liabilities resulting from non-compliant operations shall be borne by the user.
- Under no circumstances may users associate the author, contributors, or other related parties of this project with their usage of the project, nor may they hold these parties responsible for any loss or damage arising from such usage.
- The author of this project will not provide a paid version of the KS-Downloader project, nor will they offer any commercial services related to the KS-Downloader project.
- Any secondary development, modification, or compilation based on this project is unrelated to the original author. The original author assumes no liability for any consequences resulting from such secondary development. Users bear full responsibility for all outcomes arising from such modifications.
- This project grants no patent licenses; if the use of this project leads to patent disputes or infringement, the user bears all associated risks and responsibilities. Without written authorization from the author or rights holder, users may not use this project for any commercial promotion, marketing, or re-licensing.
- The author reserves the right to terminate service to any user who violates this disclaimer at any time and may require them to destroy all obtained code and derivative posts.
- The author reserves the right to update this disclaimer at any time without prior notice. Continued use of the project constitutes acceptance of the revised terms.
⭐ Star History
💡 Project References
Explore related projects
Loading…

