A script that generates short-form videos from popular reddit threads.
Simply select a subreddit post and automatically generate a video displaying screenshots of the post and comments, along with voice-over narration and engaging background visuals. Perfect for uploading to Tiktok or Youtube shorts.
- Prompt user to select a subreddit to provide content for the video
- Fetch trending posts from the selected subreddit using the reddit API
- Prompt user to select one of the trending posts
- Fetch top comments under the selected post using the reddit API
- Generate voice-over audio for the post and its comments using the tiktok text-to-speech API
- Download screenshots of the post and its comments using playwright
- Combine the screenshots and audio files together with a background clip to form a video using moviepy
- Go to https://reddit.com/prefs/apps and follow the steps to register for usage of the Reddit API
- Obtain a reddit client ID and client secret
- Clone the repository and navigate to its directory
git clone https://github.com/Glenn-Chiang/redditor.git
cd redditor
- Create a virtual environment and install dependencies
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Create a
.envfile and fill in the values forREDDIT_CLIENT_IDandREDDIT_CLIENT_SECRETwith the credentials you obtained from Obtaining Reddit API credentials
REDDIT_CLIENT_ID='your-client-id'
REDDIT_CLIENT_SECRET='your-client-secret'
Run the script
python main.py
Warning: do not run the script on multiple terminal windows at the same time as doing so may cause the script to read the wrong files

