Skip to main content
Current version: v4.0.7
1

Clone the repository

git clone https://github.com/ihmily/DouyinLiveRecorder.git
cd DouyinLiveRecorder
2

Install Python ≥ 3.10

DouyinLiveRecorder requires Python 3.10 or later.Check your version:
python --version
uv is the recommended way to manage Python and virtual environments for this project. It can install the correct Python version automatically and handles the virtual environment without extra steps.Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
3

Create a virtual environment

python -m venv .venv

# Activate — Bash / macOS / Linux
source .venv/bin/activate

# Activate — Windows PowerShell
# .venv\Scripts\activate.ps1

# Activate — Windows CMD
# .venv\Scripts\activate.bat
4

Install dependencies

pip3 install -U pip && pip3 install -r requirements.txt
The full dependency list (requirements.txt):
requests>=2.31.0
loguru>=0.7.3
pycryptodome>=3.20.0
distro>=1.9.0
tqdm>=4.67.1
httpx[http2]>=0.28.1
PyExecJS>=1.5.1
If installation is slow, you can specify a mirror with -i for pip or --index for uv. For example:
pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# or
uv sync --index https://pypi.tuna.tsinghua.edu.cn/simple
5

Install FFmpeg

FFmpeg is not required to install manually on Windows. The application will detect if FFmpeg is missing and download it automatically on first run.
The auto-installer downloads a prebuilt FFmpeg binary from a hosted archive and places it in the ffmpeg/ subdirectory next to main.py. An internet connection is required for the first run if FFmpeg is not already present.
6

Configure recording URLs

Open config/URL_config.ini and add the live stream URLs you want to record, one per line:
https://live.douyin.com/745964462470
https://www.tiktok.com/@pearlgaga88/live
https://live.bilibili.com/320
To temporarily skip a URL without removing it, prefix the line with #:
# https://live.douyin.com/745964462470
To record a specific quality for a single stream, prepend the quality label separated by a comma:
超清,https://live.douyin.com/745964462470
7

Run the application

python main.py
Recorded videos are saved to the downloads/ directory, organised by platform.

Stopping the recorder

Option 1 — Keyboard shortcut: Press Ctrl+C in the terminal window running main.py.Option 2 — VBScript helper: Double-click StopRecording.vbs in the project root. A dialog will confirm before terminating all active FFmpeg and Python recording processes. The script waits 10 seconds before stopping the main Python process to allow in-progress recordings to finalize.Option 3 — Stop a single stream: Add # before the URL in URL_config.ini. The recorder will detect the change and stop recording that stream gracefully.
Avoid killing the process with kill -9 or closing the terminal window abruptly while recordings are active. This can corrupt the video files currently being written. Use Ctrl+C or StopRecording.vbs for a clean shutdown.
Set the recording format to ts in config/config.ini. TS files remain playable even if recording is interrupted unexpectedly.

Running as a background service

To keep the recorder running after you close a terminal session on Linux or macOS, use nohup:
nohup python3 main.py > logs/nohup.log 2>&1 &
This redirects all output to logs/nohup.log and runs the process in the background. To stop it later:
# Find the process ID
pgrep -f main.py

# Stop it gracefully
kill <PID>

Build docs developers (and LLMs) love