Scrape and download Tiktok videos by trending keywords then compile them into a single video to be uploaded to YouTube by command line.
Checkout demo Youtube channel: https://www.youtube.com/channel/UC3Ck8QcuaJ0JRUrN39YRbLg
- Download unlimited post metadata from the Hashtag and Trends
- Save post metadata to the JSON/CSV files
- Combine videos into a single video with ffmpeg
- Script to upload the video to YouTube directly
- Automatically generate the description, tags and thumbnail to put on YouTube
Requirements:
- Node.js (v14.x or later)
npm install
# or
yarn
yarn content:pull [...options]
Options:
- type:
trend
orhashtag
[default:hashtag
] - hashtag: tiktok hashtag [default:
xuhuong
] - device:
phone
ordesktop
[default:phone
] - duration: the duration of the video by minutes [default:
13
] - banner: number of banners to create [default:
30
] - batchSize: number of videos to process [default:
8
]
Example:
yarn content:pull --type=trend --hashtag=xuhuong --device=phone --duration=13 --banner=30 --batchSize=8
Required: OAuth 2.0 Client IDs from the Google Developers Console
Please follow the instructions in the Turn on the YouTube Data API. After that, move the downloaded file to /credentials
folder and rename it client_secret.json
.
yarn content:upload [...options]
Options:
- title: title of the video
- bannerId: banner id to upload
- hashtag: tiktok hashtag, should be the same as the one used in the previous step
Example:
yarn content:upload --title="Xu Huong" --bannerId="1" --hashtag="xuhuong"
# Create banner image
npx ts-node src/utils/banner.test.ts
# collector normalization
npx ts-node src/utils/normalization.test.ts
# Scrape tiktok
npx ts-node src/utils/scraper.test.ts
Please feel free to open an issue or create a pull request. I would love to see your work!
MIT Free Software