# TikTokDownloader **Repository Path**: yonglelolu/TikTokDownloader ## Basic Information - **Project Name**: TikTokDownloader - **Description**: GitHub 同步仓库:TikTok 发布/喜欢/合辑/直播/视频/图集/音乐;抖音发布/喜欢/收藏/收藏夹/视频/图集/实况/直播/音乐/合集/评论/账号/搜索/热榜数据采集工具/下载工具 - **Primary Language**: Python - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: https://github.com/JoeanAmier/TikTokDownloader - **GVP Project**: No ## Statistics - **Stars**: 39 - **Forks**: 17 - **Created**: 2024-03-02 - **Last Updated**: 2026-04-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
DouK-Downloader

DouK-Downloader

简体中文 | English


GitHub GitHub forks GitHub Repo stars GitHub code size in bytes
Static Badge GitHub release (with filter) Static Badge GitHub all releases

🔥 TikTok Posts/Liked/Mix/Live/Video/Image/Music; DouYin Posts/Liked/Favorites/Collections/Video/Image/LivePhoto/Live/Music/Mix/Comments/Account/Search/Hot Board Data Acquisition Tools: Fully open-source, free data collection and file download tool based on HTTPX module implementation; batch download of DouYin account posts works, liked works, favorites works and collections works; batch download of TikTok account posts works and liked works; download of DouYin linked or TikTok linked works; obtain DouYin live stream push addresses; download DouYin live stream video; obtain TikTok live stream push addresses; download TikTok live stream video; collect DouYin works comments data; batch download of DouYin Mix works; batch download of TikTok Mix works; collect detailed data of DouYin accounts; collect DouYin user/works/live search results; collect DouYin Hot Board data.

⭐ Previous project names: TikTokDownloader

📣 This project will undergo code structure refactoring in the future, with the goal of making the code more robust and providing better maintainability and extensibility. If you have any thoughts on project design, implementation methods, or optimization ideas, you are welcome to make suggestions or participate in discussions!

⭐ Due to the author's limited energy, I was unable to update the English document in a timely manner, and the content may have become outdated, partial translation is machine translation, the translation result may be incorrect, Suggest referring to Chinese documentation. If you want to contribute to translation, we warmly welcome you.


# 📝 Project Features
Function List (Click to Expand)
# 💻 Program Screenshot

Watch Demo on Bilibili; Watch Demo on YouTube

## Terminal interaction mode

It is recommended to manage accounts through configuration files. For more information, please refer to the documentation

![终端模式截图](docs/screenshot/终端交互模式截图EN1.png) ***** ![终端模式截图](docs/screenshot/终端交互模式截图EN2.png) ***** ![终端模式截图](docs/screenshot/终端交互模式截图EN3.png) ## Web UI interaction mode > **The project code has been refactored; the code for this mode has not yet been updated. It will be reopened after future development is completed!** ## Web API mode ![WebAPI模式截图](docs/screenshot/WebAPI模式截图EN1.png) ***** ![WebAPI模式截图](docs/screenshot/WebAPI模式截图EN2.png) > **After starting this mode, Open http://127.0.0.1:5555/docs or http://127.0.0.1:5555/redoc to access the automatically generated documentation!** ### API call example code ```python from httpx import post from rich import print def demo(): headers = {"token": ""} data = { "detail_id": "0123456789", "pages": 2, } api = "http://127.0.0.1:5555/douyin/comment" response = post(api, json=data, headers=headers) print(response.json()) demo() ``` # 📋 Project Instructions ## Quick Start

⭐ Mac OS and Windows 10 and above users can go to Releases or Actions to download the compiled program, ready to use!

⭐ This project includes GitHub Actions for automatic building executable files. Users can use GitHub Actions to build the latest source code into executable files at any time!

⭐ 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.


  1. Run the executable file or configure the environment to run (choose one of the two)
      Run the executable file
    1. Download the executable file compressed file built by Releases or Actions.
    2. After extracting, open the program folder and double-click to run main.
      Configure the environment to run [//]: # (
    1. Install Python interpreter version not lower than 3.12
    2. )
    3. Install the Python interpreter version 3.12
    4. Download the latest source code or the source code released in Releases to your local machine
      1. Install project dependencies using pip
      2. Run the command python -m venv venv to create a virtual environment (optional)
      3. Run the command .\venv\Scripts\activate.ps1 or venv\Scripts\activate to activate the virtual environment (optional)
      4. Run the command pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt to install the required modules for the program
      5. Run the command python .\main.py or python main.py to start DouK-Downloader
        Install project dependencies using uv (recommended)
      1. Run the command uv sync --no-dev to synchronize environment dependencies
      2. Run the command uv run main.py to start DouK-Downloader
  2. Read the disclaimer of DouK-Downloader and enter content according to the prompt.
  3. Write Cookie Information into Configuration File
      Read Cookie from Clipboard(Recommended)
    1. Refer to the Cookie Extraction Tutorial, copy the required Cookie to the clipboard
    2. Select the Extracting cookie from clipboard option, the program will automatically read the Cookie from the clipboard and write it into the configuration file
      Read Cookie from Browser
    1. Select the Extracting cookie from browser option, then follow the prompts to input the browser type or its corresponding number
      Obtain Cookie via QR Code Login (No longer valid)
    1. Select the Scan code to login and get cookies (DouYin) option, the program will display a login QR code image and open it with the default application
    2. Use the DouYin app to scan the QR code and log in
    3. Follow the prompts, the program will automatically write the Cookie into the configuration file
  4. Return to the program interface, sequentially select Terminal Mode -> Batch Download Works from Links -> Manually enter the works links to be collected.
  5. Input the DouYin works link to download the works file (the TikTok platform requires more initial setup, please refer to the documentation for details).
  6. For more detailed instructions, please see Project Documentation.

⭐ It is recommended to use Windows Terminal (the default terminal that comes with Windows 11).

### Docker Container
  1. Get the image
  2. Create the container: docker run --name ContainerName(optional) -p HostPort:5555 -v tiktok_downloader_volume:/app/Volume -it <image name>.

  3. Note: The <image name> here must be consistent with the image name you used in the first step (joeanamier/tiktok-downloader or ghcr.io/joeanamier/tiktok-downloader)
  4. Run the container

Docker containers cannot directly access the host machine's file system, and some features may be unavailable, for example: Get Cookie from Browser; if there are any other issues, please report!


## About Cookie [Click to view Cookie tutorial](https://github.com/JoeanAmier/TikTokDownloader/blob/master/docs/Cookie%E8%8E%B7%E5%8F%96%E6%95%99%E7%A8%8B.md) > * Cookie only needs to be re-written to the configuration file after it expires, and not every time the program is run. > > * The Cookie can affect the resolution of the video files downloaded from the DouYin platform. If you are unable to download high-resolution video files, please try updating the Cookie! > > * When the program fails to obtain data, you can try updating the Cookie or using a Cookie that is already logged in!
## Other Instructions

Build of Executable File Guide

Build of Executable File Guide (Click to Expand) 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 1. Click the **Fork** button at the top right of the project repository to fork it to your personal GitHub account 2. Your forked repository address will look like this: `https://github.com/your-username/this-repo` --- #### 2. Enable GitHub Actions 1. Go to the page of your forked repository 2. Click the **Settings** tab at the top 3. Click the **Actions** tab on the right 4. Click the **General** option 5. Under **Actions permissions**, select **Allow all actions and reusable workflows** and click the **Save** button --- #### 3. Manually Trigger the Build Process 1. In your forked repository, click the **Actions** tab at the top 2. Find the workflow named **构建可执行文件** 3. Click the **Run workflow** button on the right: - Select the **master** or **develop** branch - Click **Run workflow** --- #### 4. Check the Build Progress 1. On the **Actions** page, you can see the execution records of the triggered workflow 2. Click on the run record to view detailed logs to check the build progress and status --- #### 5. Download the Build Result 1. Once the build is complete, go to the corresponding run record page 2. In the **Artifacts** section at the bottom of the page, you will see the built result file 3. Click to download and save it to your local machine to get the built program --- ### Notes 1. **Resource Usage**: - GitHub provides free build environments for Actions, with a monthly usage limit (2000 minutes) for free-tier users 2. **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 3. **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](https://github.com/JoeanAmier/TikTokDownloader/issues) #### 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
## Program Update

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.

# ⚠️ Disclaimer
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. The author of this project will not provide a paid version of the DouK-Downloader project, nor will they offer any commercial services related to the DouK-Downloader project.
  10. 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.
  11. 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.
  12. 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 works.
  13. 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.
Before using the code and functionalities of this project, please carefully consider and accept the above disclaimer. If you have any questions or disagree with the statement, please do not use the code and functionalities of this project. If you use the code and functionalities of this project, it is considered that you fully understand and accept the above disclaimer, and willingly assume all risks and consequences associated with the use of this project.

🌟 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.

Reference materials:

# ♥️ Support the Project

If DouK-Downloader has been helpful to you, please consider giving it a Star ⭐. Your support is greatly appreciated!

微信(WeChat) 支付宝(Alipay)
微信赞助二维码 支付宝赞助二维码

If you're willing, consider making a contribution to provide additional support for DouK-Downloader!

# 💰 Project Sponsorship ## DartNode [![Powered by DartNode](docs/AD/DartNode_AD.png)](https://dartnode.com "Powered by DartNode - Free VPS for Open Source") *** ## ZMTO

ZMTO

ZMTO: A professional cloud infrastructure provider offering sophisticated solutions with reliable technology and expert support. We also empower qualified open source initiatives with enterprise-grade VPS infrastructure, driving sustainable development and innovation in the open source ecosystem.

*** ## Swiftproxy

Swiftproxy

Access a global pool of 80M+ residential IPs optimized for TikTok and Douyin data extraction. Swiftproxy helps bypass rate limits, reduce blocks, and ensures stable downloads with seamless IP rotation.

*** ## TikHub

TIKHUB

TikHub API offers over 700 endpoints to retrieve and analyze data from 14+ social media platforms—including videos, users, comments, stores, products, trends, and more—enabling one-stop access and analysis of all your data.

Use invitation code: ZrdH8McC to register and recharge to get $2 credit.

# ✉️ Contact the Author

The author's other open-source projects:

⭐ Star History

Star History Chart

# 💡 Project References * https://github.com/Johnserf-Seed/f2 * https://github.com/Evil0ctal/Douyin_TikTok_Download_API * https://github.com/justbeluga/tiktok-web-reverse-engineering * https://github.com/ihmily/DouyinLiveRecorder * https://github.com/encode/httpx/ * https://github.com/Textualize/rich * https://github.com/omnilib/aiosqlite * https://github.com/Tinche/aiofiles * https://github.com/pyinstaller/pyinstaller * https://foss.heptapod.net/openpyxl/openpyxl * https://github.com/carpedm20/emoji/ * https://github.com/lxml/lxml * https://ffmpeg.org/ffmpeg-all.html