This project automates the process of creating "Reddit Story" style videos for platforms like TikTok, YouTube Shorts, and Instagram Reels. It combines text-to-speech, background videos, and title screenshots into a single video. Users can then add subtitles using CapCut.
- Python installed on your system.
- CapCut installed for adding subtitles. Tutorial Link.
- Necessary authentication for PRAW. Tutorial Link (Skip to 0:40).
- Create an Elevenlabs account and generate an API key.
- Clone this repository to your local machine.
- Navigate to the project directory.
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- On Windows:
.\venv\Scripts\activate
- On Unix or MacOS:
source venv/bin/activate
- On Windows:
- Install the required packages:
pip install -r requirements.txt
Create a config.py file in the project directory with the following variables:
SUBREDDIT_NAME = "" # Name of the subreddit to fetch posts from
PRAW_CLIENT_ID = "" # Your PRAW client ID
PRAW_CLIENT_SECRET = "" # Your PRAW client secret
PRAW_USER_AGENT = "" # User agent for PRAW (can be anything)
ELEVENLABS_API_KEY = "" # Your ElevenLabs API key
ORIGINAL_OUTPUT_PATH = "" # Path to save videos without captions
SPLICED_VIDEO_READ_PATH = "" # Path to read videos with captions from CapCut
SPLICED_VIDEO_WRITE_PATH = "" # Path to save spliced videos- Create a directory named
background_videoin the project's root directory.mkdir background_video
- Change into the
background_videodirectory:cd background_video - Use
yt-dlpto download a background video from YouTube. Replace<youtube video link>with the actual link to the video you want to use:Ensure that the downloaded video is placed within theyt-dlp <youtube video link>
background_videodirectory.
- For more information on using
yt-dlp, refer to the official documentation. - Ensure that you have the necessary permissions to use and distribute any downloaded video content.
- The ElevenLabs API, which is used for text-to-speech conversion in this project, has usage limits. The free tier offers 10,000 characters per month. Be mindful of the number of characters you are converting to avoid reaching the limit. For more details or to understand the pricing for higher usage, please refer to ElevenLabs' official documentation or pricing page.
Run main.py to generate a video combining text-to-speech, background video, and title screenshot:
python main.pyRun splice_videos.py to cut each video into segments of 59 seconds or less:
python splice_videos.pymain.py: Main script to generate videos.accelerate_audio.py: Speeds up audio files.content_moderation.py: Replaces trigger words in content.editing.py: Handles video editing tasks.posts.py: Retrieves posts from a specified subreddit using PRAW.screenshot_post.py: Takes screenshots of post titles.tts.py: Converts text to speech using ElevenLabs API.splice_videos.py: Slices videos into segments.
This project aims to simplify the creation of "Reddit Story" style videos by automating various tasks, making content creation faster and more efficient for content creators.