Skip to content

Latest commit

 

History

History
68 lines (48 loc) · 2.4 KB

README.md

File metadata and controls

68 lines (48 loc) · 2.4 KB

TikTok video downloader

Simple CLI tool for downloading videos from TikTok.

Project status

This project is currently active and maintained.

GitHub top language GitHub last commit GitHub repo size GitHub code size in bytes

Requirements

This project requires Node.js and npm. Also you need to have curl installed.

Usage

npm install

Download a single video

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.

Download multiple videos from a txt file

node .\src\app.js --file '<path_to_file>'
# e.g.
node .\src\app.js --file urls.txt

Extract video urls from a txt file containing HTML from a profile of some tiktok user

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.

TODO

  • 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

Contributing

Feel free to edit the code and submit a pull request.