TikTokDownloader
Simplified Chinese | English
TikTok homepage/collection/live broadcast/video/album/original sound; TikTok homepage/video/album/collection/live broadcast/original sound/collection/ comments / account / search /hot list data collection tool: completely open source, implemented based on HTTPX module Free tools; batch download Douyin accounts to post, like, and collect works; batch download TikTok accounts to post, like, and collect works; download Douyin links or TikTok Link to the work; get the Douyin live streaming address; download the Douyin live video; get the TikTok live streaming address; download the TikTok live video; Collecting comments data on Douyin works ; Batch download of Douyin collection works; Batch download of TikTok collection works; Collect detailed data of Douyin account ; Collect Douyin users/works/live broadcast search results ; Collect Douyin hot list data.
️ 5.5 Beta
of this project is refactoring the code, and some functions may not work properly. It is recommended to use version 5.4
for the time being!
This project is completely free and open source, without any paid functions, please do not be deceived!
Project function(Function)
- ✅ Download Douyin videos/photo albums without watermarks
- ✅ Download TikTok videos/photo albums without watermarks
- ✅ Batch download works posted/liked/collected by Douyin account
- ✅ Batch download TikTok account posts/like works
- ✅Collect Douyin/TikTok detailed data
- ✅ Batch download link works
- ✅ Download works in batches with multiple accounts
- ✅ Automatically skip downloaded files
- ✅ Persistent storage of collected data
- ✅ Download dynamic/static cover images
- ✅ Get the Douyin live streaming address
- ✅ Get TikTok live streaming address
- ✅ Call ffmpeg to download live broadcast
- ✅ Web UI interactive interface
- ✅ Collect comment data of Douyin works
- ✅ Batch download Douyin collection works
- ✅ Batch download TikTok collection works
- ✅ Record statistics such as likes and collections
- ✅ Filter the release time of works
- ✅ Support incremental download of account works
- ✅ Supports the use of agents to collect data
- ✅ Support LAN remote access
- ✅ Collect Douyin account details
- ✅ Work statistics updated
- ✅ Automatically update account nickname
- ✅ Deploy to private server
- ✅ Deploy to public server
- ✅Collect Douyin search data
- ✅ Collect Douyin hot list data
- ✅ Record downloaded work ID
- ☑️
Scan the QR code to log in to get cookies - ✅ Get cookies from browser
- ✅Supports Web API calls
- ✅ Supports multi-threaded downloading of works
- ✅ File integrity processing mechanism
- ✅ Customize rules to filter works
- ✅ Support file breakpoint resume download
Program interface (Screenshot)
Terminal interactive mode:
Web UI interaction mode:
Web API interface mode:
? Run the demo (Example)
? Click on the picture to watch the demonstration video. It is recommended to manage the account through the configuration file. For more information, please refer to the documentation.
? Project status (Status)
- ? After testing, the source code released by Releases has been verified that all functions are available normally.
- ? TikTokDownloader development plan and progress can be found in Projects
- ? Please note that the latest source code (Beta version) may have some unstable bugs
- ? If you find a program bug during use, please inform the author in time to fix it
?Project instructions(Instructions)
Quick start
Users of Mac OS, Windows 10 and above can go to Releases to download the compiled program and use it out of the box!
Note: The Mac OS platform executable file main
may need to be started from the terminal command line; due to device limitations, the Mac OS platform executable file has not been tested and availability cannot be guaranteed!
- Run the executable file or configure the environment to run
Run executable file- Download the executable file compressed package released by Releases
- After unzipping, open the program folder and double-click to run
main
Configure the environment to run- Install a Python interpreter version no lower than
3.12
- Download the latest source code or the source code released by Releases to your local computer
- Run the
python -m venv venv
command to create a virtual environment (optional) - Run the
.venvScriptsactivate.ps1
or venvScriptsactivate
command to activate the virtual environment (optional) - Run
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
command to install the modules required by the program - Run
python .main.py
or python main.py
command to start TikTokDownloader
- Read the disclaimer of TikTokDownloader and enter the content according to the prompts
- Write cookie information to configuration file
Manually copy and paste cookies (recommended)- Refer to the Cookie extraction tutorial and copy the required cookies to the clipboard
- Select
复制粘贴写入Cookie
option and follow the prompts to write the Cookie to the configuration file
Get cookies from browser (recommended)- Select the option
从浏览器获取Cookie
and follow the prompts to select the browser type
Scan the QR code to log in to obtain cookies (deprecated)- Select
扫码登录获取Cookie
option, the program will display the login QR code image, and use the default application to open the image - Use Douyin APP to scan the QR code and log in to your account
- Follow the prompts to write cookies to the configuration file
- Return to the program interface, select
终端交互模式
->批量下载链接作品(通用)
->手动输入待采集的作品链接
- Enter the TikTok work link to download the work file (the TikTok platform requires more initial settings, see the documentation for details)
- Please see the project documentation for more detailed instructions
It is recommended to use Windows Terminal (Windows 11 comes with the default terminal)
Docker container
- Get image
- Method 1: Use
Dockerfile
to build the image - Method 2: Use
docker pull joeanamier/tiktokdownloader
command to pull the image
- Create a container:
docker run -it joeanamier/tiktokdownloader
- Run container
- Start the container:
docker start -i 容器名称/容器ID
- Restart the container:
docker restart -i 容器名称/容器ID
Docker containers cannot directly access the host's file system, and some functions are unavailable, such as从浏览器获取Cookie
; please report any abnormalities in other functions!
About cookies
Click to view cookies to get the tutorial
Program functions | Do you need to log in? |
---|
Download account to publish works | ⭕Recommended to log in |
Download account, like works | ⭕Recommended to log in |
Download link works | ⭕Recommended to log in |
Get the live streaming address | No login required |
Download live video | No login required |
Get work review data | ⭕Recommended to log in |
Download the collection | ⭕Recommended to log in |
Get account data | ⭕Recommended to log in |
Collect search results | ⭕Recommended to log in |
Collect hot list data | No login required |
Download collection | ✔️Login required |
Download favorites | ✔️Login required |
Get collection collection data | ✔️Login required |
Get collection music data | ✔️Login required |
Get collection short drama data | ✔️Login required |
The cookie only needs to be rewritten to the configuration file after it expires. The configuration file does not need to be written every time the program is run!
Cookies will affect the resolution of video files downloaded from Douyin platform. If you cannot download 1080P video files, please try to update cookies!
When the program fails to obtain data, you can try to update the cookie or use the logged-in cookie!
Other instructions
- When the program prompts the user for input, just press Enter to return to the previous menu, and enter
Q
or q
to end the run. - Since obtaining the data of the account's liked works and collected works only returns the release date of the liked/collected works, and does not return the operation date, the program needs to obtain all the data of the liked/collected works and then perform date filtering; if the number of works is large, it may take a long time time; the number of requests can be controlled through the
max_pages
parameter - Obtaining the published work data of a private account requires a logged-in cookie, and the logged-in account needs to follow the private account
- When downloading account works or collection works in batches, if the corresponding nickname or logo changes, the program will automatically update the nickname and logo in the file name of the downloaded work.
- When the program downloads a file, it will first download the file to a temporary folder, and then move it to the storage folder after the download is completed; the temporary folder will be cleared when the program ends.
批量下载收藏作品模式
currently only supports downloading collection works of the account corresponding to the currently logged-in cookie, and does not support multiple accounts at the moment.- If you want the program to use a proxy to request data, you must set
proxy
parameter in settings.json
, otherwise the program will not use the proxy. - When exiting the program, please end the run in the normal way or press Ctrl + C to end the run. Do not directly click the close button of the terminal window to end the run, otherwise data will be lost.
- If your computer does not have a suitable program to edit JSON files, it is recommended to use JSON online tools to edit the configuration file content.
- When the program asks the user to enter content or links, please be careful to avoid entering content or links that contain line breaks, which may cause unexpected problems.
- This project will not support the downloading of paid works. Please do not provide any feedback about the downloading of paid works.
- Windows systems need to run the program as an administrator to read Chromium, Chrome, and Edge browser cookies
Program update
Solution 1: Download and unzip the file, and copy the old version of TikTokDownloader.db
file and settings.json
file to the _internal
folder.
Option 2: Download and unzip the file (do not run the program), copy all files, and directly overwrite the old version of the file.
️ Disclaimers
- The user's use of this project is at the user's own discretion and risk. The author is not responsible for any losses, liabilities, or risks incurred by users using this project.
- The code and functionality provided by the authors of this project are developments based on existing knowledge and technology. The author tries his best to ensure the correctness and security of the code, but does not guarantee that the code is completely free of errors or defects.
- Users must strictly abide by the requirements of GNU General Public License v3.0 when using this project, and indicate the use of GNU General Public License v3.0 code in appropriate places.
- The user may not under any circumstances associate the authors, contributors or other relevant parties of this project with the user's use of the project, or require them to be responsible for any loss or damage caused by the user's use of the project.
- When using the code and functions of this project, users must research relevant laws and regulations on their own and ensure that their usage is legal and compliant. Any legal liability and risks arising from violation of laws and regulations shall be borne by the user.
- The author of this project will not provide a paid version of the TikTokDownloader project, nor will it provide any commercial services related to the TikTokDownloader project.
- Any secondary development, modification or compilation of programs based on this project has nothing to do with the original author. The original author does not assume any responsibility related to the secondary development behavior or its results. The user should be responsible for any possible consequences caused by the secondary development. Take full responsibility for all situations.
Please carefully consider and accept the above disclaimer before using the code and functions of this project. If you have any questions or disagree with the above statement, please do not use the code and functions of this project. If you use the code and functions of this project, you are deemed to have fully understood and accepted the above disclaimer, and you voluntarily bear all risks and consequences of using this project. ✉️Contact the author(Contact)
- Author's email: [email protected]
- Author WeChat: Downloader_Tools
- WeChat public account: Downloader Tools
- Discord Community : Click to join the community
- QQ group chat (project communication): Scan the QR code to join the group chat
The author's other open source projects:
- XHS-Downloader (Xiaohongshu) : https://github.com/JoeanAmier/XHS-Downloader
- KS-Downloader (Kuaishou) : https://github.com/JoeanAmier/KS-Downloader
♥️ Support project(Support)
If TikTokDownloader is helpful to you, please consider giving it a star . Thank you for your support!
WeChat | Alipay |
---|
| |
If you'd like, consider making a grant to provide additional support for TikTokDownloader !
? Project sponsorship (Sponsor)
JetBrains Tools
JetBrains supports active projects recognized by the global open source community and provides free licenses for non-commercial development.
TikHub
TikHub is a leading data interface service provider that focuses on providing high-quality data interfaces covering multiple popular platforms, including Douyin, TikTok, Xiaohongshu, Instagram, Twitter and Kuaishou.
TikHub also provides customized services, such as live broadcast room monitoring, work monitoring and talent monitoring, to meet the needs of different business scenarios.
By checking in every day, users can get a certain amount of usage for free; you can use my referral link : https://beta-web.tikhub.io/users/signup?referral_code=X084IATy or referral code : X084IATy
to register and recharge Get $2
credit!
TikHub provides the following services:
- Rich data interface
- Get free quota by signing in every day
- High-quality API services
- Official website: https://tikhub.io/
- Project address: https://github.com/TikHubIO/
- User login address: https://beta-web.tikhub.io/
Project Reference(Refer)
- https://github.com/Johnserf-Seed/f2
- https://github.com/Johnserf-Seed/TikTokDownload
- https://github.com/Evil0ctal/Douyin_TikTok_Download_API
- https://github.com/NearHuiwen/TiktokDouyinCrawler
- 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/thewh1teagle/rookie
- 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
- https://html5up.net/hyperspace