Automate creating video compilations from tiktok content. Collect videos from TikTok, create compilations with smooth transitions, generate thumbnails, and upload directly to YouTube.
If you find ReelComp useful, please consider sponsoring the project to support ongoing development and maintenance:
Your sponsorship helps keep this project active and improving!
- Python 3.8+
- FFmpeg
- Playwright (for browser automation)
# Clone and setup
git clone https://github.com/YOUR_USERNAME/reelcomp.git
cd reelcomp
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python -m playwright install chromium- macOS:
brew install ffmpeg - Ubuntu/Debian:
sudo apt update && sudo apt install ffmpeg - Windows: Download from ffmpeg.org and add to PATH
python -m src.url_collector.tiktok_scraper --count 10 --output tiktok_urls.txt --hashtag funnypython -m src.main --urls tiktok_urls.txt --title "Funny Compilation"You can now let ReelComp automatically fetch new TikTok URLs and create a compilation or Shorts in one step:
# Fetch 10 trending TikToks with hashtag 'funny' and create a compilation
python -m src.main --auto-fetch --title "Weekly Compilation" --upload
# Customize hashtag and number of videos
python -m src.main --auto-fetch --fetch-hashtag dance --fetch-count 15 --title "Best Dance TikToks" --upload
# Automatically fetch and create Shorts (only one Shorts video will be created)
python -m src.main --auto-fetch --shorts --title "Funny TikTok Shorts"--auto-fetch: Automatically collects new TikTok URLs if none are provided--fetch-hashtag: Hashtag to use for collection (default: funny)--fetch-count: Number of TikToks to fetch (default: 10)--shorts: (Recommended) Create a single Shorts video from the compilation (default if any Shorts flag is set)--generate-shorts,--compilation-short: [DEPRECATED] Use--shortsinstead. These flags now behave identically and only create one Shorts video from the compilation.
Note: Whether you use auto-fetch or manual workflows, only one Shorts video is ever created, always based on your compilation. Multiple Shorts from individual videos are no longer supported.
# Collect videos and create compilation in one command
python -m src.url_collector.tiktok_scraper --count 10 --output tiktok_urls.txt --hashtag funny && python -m src.main --urls tiktok_urls.txt --title "Weekly Compilation" --upload# Create a YouTube Short from compilation
python -m src.main --urls tiktok_urls.txt --title "Funny Moments" --shortsYou can automate the entire process to run weekly (or on any schedule) using a shell script and cron.
Create a file called tiktok_weekly.sh:
#!/bin/bash
# Example: Collect 10 funny TikToks and create/upload a compilation
python -m src.url_collector.tiktok_scraper --count 10 --output tiktok_urls.txt --hashtag funny
python -m src.main --urls tiktok_urls.txt --title "Weekly Funny Compilation" --uploadMake it executable:
chmod +x tiktok_weekly.shTo run every Wednesday at 10:10 AM, add this to your crontab (crontab -e):
10 10 * * 3 /path/to/your/reelcomp/tiktok_weekly.sh >> /path/to/your/reelcomp/logs/cron.log 2>&1
Note:
- Do not include any real TikTok URLs or sensitive data in the repository.
- Users should create their own
tiktok_urls.txtand customize the script for their needs. tiktok_urls.txtandtiktok_weekly.share already in.gitignoreto prevent accidental commits of sensitive or user-specific data.
# Basic Settings in .env file
APP_MAX_VIDEOS_PER_COMPILATION=15 # Maximum videos to include
APP_VIDEO_WIDTH=1080 # Output video width
APP_VIDEO_HEIGHT=1920 # Output video height
APP_TRANSITION_TYPE=random # Transition between clips
# YouTube Settings
YOUTUBE_PRIVACY_STATUS=unlisted # Video privacy (private, unlisted, public)
Create a file (e.g., config.json):
{
"app": {
"max_videos_per_compilation": 10,
"video_width": 1920,
"video_height": 1080,
"transition_type": "crossfade",
"use_intro": true,
"intro_path": "data/assets/my_intro.mp4"
},
"youtube": {
"privacy_status": "unlisted"
}
}Then run:
python -m src.main --urls tiktok_urls.txt --config config.json- Videos Not Downloading: Check network connection, TikTok might have updated site structure
- YouTube Upload Fails: Delete
credentials/youtube_token.jsonand reauthenticate - Poor Video Quality: Increase
bitratesetting or resolution - FFmpeg Not Found: Verify installation with
ffmpeg -versionand check PATH
reelcomp/
├── src/ # Source code
│ ├── main.py # Main entry point
│ ├── url_collector/ # Video URL collection
│ ├── video_collection/ # Video downloading
│ ├── video_processing/ # Compilation creation
│ ├── youtube_uploader/ # YouTube integration
│ ├── thumbnail_generator/ # Thumbnail creation
│ └── utils/ # Utility functions
├── data/ # Data storage (created at runtime)
└── credentials/ # API credentials (empty in repo)
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please follow these guidelines:
- Follow existing code style
- Add tests for new features
- Update documentation for significant changes
- Use descriptive commit messages
- Direct Video Upload: New
--upload-existing-pathflag allows you to upload any existing video file (Shorts or compilation) directly to YouTube, bypassing the TikTok/compilation pipeline. Prints the YouTube URL upon success. - Documentation: Added usage instructions for direct video upload.
- Auto-fetch TikTok URLs: Use
--auto-fetchto automatically collect trending TikTok URLs by hashtag. - Unified Shorts Creation: Only one Shorts video is created, always based on the compilation. Per-video Shorts are no longer supported.
- Improved CLI: New
--shortsflag (recommended) for Shorts creation.--generate-shortsand--compilation-shortare deprecated and behave identically. - Updated Documentation: README and CLI help updated for new workflows and options.
- Bug fixes and usability improvements.
- Initial release
- TikTok video collection by hashtag
- Compilation creation with transitions
- Thumbnail generation
- YouTube Shorts creation
- YouTube upload functionality
This project is licensed under the MIT License.
This tool is for educational purposes only. Always respect platform terms of service and copyright laws. Ensure you have permission to use and redistribute content.