Skip to content

Glenn-Chiang/redditor

Repository files navigation

redditor

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.

thumbnail thumbnail

How it works

  1. Prompt user to select a subreddit to provide content for the video
  2. Fetch trending posts from the selected subreddit using the reddit API
  3. Prompt user to select one of the trending posts
  4. Fetch top comments under the selected post using the reddit API
  5. Generate voice-over audio for the post and its comments using the tiktok text-to-speech API
  6. Download screenshots of the post and its comments using playwright
  7. Combine the screenshots and audio files together with a background clip to form a video using moviepy

Getting started

Obtaining Reddit API credentials

  1. Go to https://reddit.com/prefs/apps and follow the steps to register for usage of the Reddit API
  2. Obtain a reddit client ID and client secret

Installation and setup

  1. Clone the repository and navigate to its directory
git clone https://github.com/Glenn-Chiang/redditor.git
cd redditor
  1. Create a virtual environment and install dependencies
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
  1. Create a .env file and fill in the values for REDDIT_CLIENT_ID and REDDIT_CLIENT_SECRET with the credentials you obtained from Obtaining Reddit API credentials
REDDIT_CLIENT_ID='your-client-id'
REDDIT_CLIENT_SECRET='your-client-secret'

Usage

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

About

A script that generates short videos from reddit threads

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages