MCPcopy Index your code
hub / github.com/JoeanAmier/TikTokDownloader

github.com/JoeanAmier/TikTokDownloader @5.7 sqlite

repository ↗ · DeepWiki ↗ · release 5.7 ↗
1,052 symbols 4,125 edges 119 files 56 documented · 5% 4 cross-repo links
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 addresses; download DouYin live stream video; obtain TikTok live stream 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

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

  • ✅ Download DouYin video/image without watermarks
  • ✅ Download DouYin live photo without watermarks
  • ✅ Download the highest quality video file
  • ✅ Download TikTok video source files
  • ✅ Download TikTok video/image without watermarks
  • ✅ Download of DouYin account posts/liked/favorites works
  • ✅ Download of TikTok account posts/liked works
  • ✅ Collect detailed data from DouYin/TikTok
  • ✅ Batch download of linked works
  • ✅ Batch download of works from multiple accounts
  • ✅ Automatically skip already downloaded files
  • ✅ Persistently save collected data
  • ✅ Support CSV/XLSX/SQLite format for saving data
  • ✅ Download dynamic/static cover images
  • ✅ Obtain DouYin live stream addresses
  • ✅ Obtain TikTok live stream addresses
  • ✅ Use ffmpeg to download live video
  • ✅ Web UI interaction interface
  • ✅ Collect comments data from DouYin works
  • ✅ Batch download of DouYin Mix works
  • ✅ Batch download of TikTok Mix works
  • ✅ Record statistics such as likes and favorites
  • ✅ Filter works based on publication time
  • ✅ Support incremental downloading of account works
  • ✅ Support data Collections using proxies
  • ✅ Support remote access via LAN
  • ✅ Collect detailed data from DouYin accounts
  • ✅ Update statistics of works
  • ✅ Support custom account/mix mark
  • ✅ Automatically update account nickname/mark
  • ✅ Deploy to private servers
  • ✅ Deploy to public servers
  • ✅ Collect DouYin search data
  • ✅ Collect DouYin hot board data
  • ✅ Record IDs of already downloaded works
  • ☑️ Scan QR code to log in and obtain Cookies
  • ✅ Obtain Cookies from browsers
  • ✅ Support Web API calls
  • ✅ Support multithreaded downloading of works
  • ✅ File integrity processing mechanism
  • ✅ Custom rules for filtering works
  • ✅ Archive and save works files by folder
  • ✅ Customize file size limit
  • ✅ Support resume downloading of files from breakpoints
  • ✅ Monitor clipboard links to download works

💻 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

终端模式截图


终端模式截图


终端模式截图

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模式截图


WebAPI模式截图

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

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: The executable file main on Mac OS may need to be started from the terminal command line. Due to device limitations, the executable file on the Mac OS platform has not been tested, and its usability cannot be guaranteed!


  1. Run the executable file or configure the environment to run
      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 Python interpreter version 3.12
    4. Download the latest source code or the source code published on Releases to your local machine.
    5. Run the command python -m venv venv to create a virtual environment (optional).
    6. Run the command .\venv\Scripts\activate.ps1 or venv\Scripts\activate to activate the virtual environment (optional).
    7. Run the command pip install -r requirements.txt to install the required modules for the program.
    8. Run the command python .\main.py or python 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
    1. Refer to the Cookie Extraction Tutorial, copy the required Cookie to the clipboard
    2. Select the Read 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 Read 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 Obtain Cookie via QR Code Login option, the program will display a login QR code image and open it with the default application
    2. Use the TikTok 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 interactive mode -> Batch download link works (general) -> Manually enter the link of the works 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
    • Method 1: Build the image using the Dockerfile.
    • Method 2: Pull the image using the command docker pull joeanamier/tiktok-downloader.
    • Method 3: Pull the image using the command docker pull ghcr.io/joeanamier/tiktok-downloader.
  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
    • Start the container: docker start -i container name/container ID.
    • Restart the container: docker restart -i container name/container ID.

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

  • 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

  • When the program prompts the user for input, pressing Enter directly will return to the previous menu, and inputting Q or q will end the program's execution.
  • Since fetching data for liked and favorites works of an account only returns the publication dates of those works, not the dates of the actions (liking or favouring), the program needs to retrieve all liked and favorites works data before performing date filtering. If there are a large number of works, this may take a considerable amount of time. The number of requests can be controlled via the max_pages parameter.
  • To obtain data for posts made by a private account, a logged-in Cookie is required, and the logged-in account must follow the private account.
  • When batch downloading account posts works or mix works, if the corresponding nickname or mark parameter changes, the program will automatically update the nickname and mark parameter in the file names of the downloaded works.
  • When downloading files, the program first downloads them to a temporary folder and then moves them to the storage folder upon completion. The temporary folder will be emptied when the program ends.
  • The Batch Download Favorites Works Mode currently only supports downloading Favorites works for the account corresponding to the currentl

Core symbols most depended-on inside this repo

_
called by 460
src/models/search.py
safe_extract
called by 170
src/extract/extractor.py
info
called by 115
src/testers/logger.py
warning
called by 77
src/testers/logger.py
run
called by 65
src/application/main_terminal.py
get
called by 61
src/tools/browser.py
print
called by 61
src/record/base.py
error
called by 33
src/testers/logger.py

Shape

Method 808
Function 112
Class 111
Route 21

Languages

Python96%
TypeScript4%

Modules by API surface

src/application/main_terminal.py115 symbols
src/extract/extractor.py84 symbols
src/config/parameter.py63 symbols
src/application/main_server.py52 symbols
src/downloader/download.py46 symbols
src/encrypt/aBogus.py40 symbols
src/application/TikTokDownloader.py38 symbols
src/interface/template.py27 symbols
src/manager/database.py21 symbols
static/js/X-Bogus.js20 symbols
src/link/extractor.py19 symbols
src/interface/collects.py19 symbols

Dependencies from manifests, versioned

aiofiles24.1.0 · 1×
aiosqlite0.21.0 · 1×
emoji2.14.1 · 1×
fastapi0.116.1 · 1×
gmssl3.2.2 · 1×
lxml6.0.0 · 1×
openpyxl3.1.5 · 1×
pydantic2.11.7 · 1×
pyperclip1.9.0 · 1×
qrcode8.2 · 1×
rich14.1.0 · 1×
rookiepy0.5.6 · 1×

For agents

$ claude mcp add TikTokDownloader \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact