Simple CLI tool for downloading videos from TikTok.
This project is currently active and maintained.
This project requires Node.js and npm. Also you need to have curl installed.
npm install
node .\src\app.js --url '<video_url>'
# e.g.
node .\src\app.js --url 'https://www.tiktok.com/@mrbeast/video/7198928728674618667?is_from_webapp=1&sender_device=pc&web_id=7203836903929447942'
# or
node .\src\app.js --url 'https://www.tiktok.com/@mrbeast/video/7198928728674618667'
Note: The url must be enclosed in single quotes.
node .\src\app.js --file '<path_to_file>'
# e.g.
node .\src\app.js --file urls.txt
node .\src\app.js -n '<filename>' --extract-urls '<path_to_file>'
# e.g.
node .\src\app.js -n mrbeast --extract-urls example-html.txt
Note: First scroll down the tiktok user page until the last video appears, and then copy the
data-e2e="user-post-item-list"
element from the user's HTML using DevTools. Then paste it into a txt file and save it. Do not format the HTML code, paste it as is in the txt file.
Check my tiktok-url-getter-extension for a browser extension that extracts the HTML code from the user's profile page and saves it to a txt file.
- Add support for downloading multiple videos from txt file
- Extract video urls from a txt file containing HTML from a profile of some tiktok user
- Refactor code to pure ESM package
- Reorganize code
- Remove duplicate code
- Migrate to TypeScript
Feel free to edit the code and submit a pull request.