This project is a Reddit video generator that creates video compilations of top comments from a specified subreddit. It utilizes Python scripts and several APIs to fetch comments, convert them to audio, and combine them with videos and images. The final video is uploaded to YouTube.
- Fetches top comments from a specified subreddit using the Reddit API.
- Converts text to speech using the StreamElements API.
- Captures screenshots of comments using Selenium.
- Creates videos using MoviePy, integrating audio and images.
- Uploads the final video to YouTube via the YouTube Data API.
Before running the project, ensure you have the following software installed:
- Python 3.7 or later
- Geckodriver for Selenium
- Firefox browser
All required Python packages are listed in requirements.txt
. You can install them using the following command:
pip install -r requirements.txt
Create a config.json
file based on the provided config_example.json
. Fill in the necessary details such as API keys, file paths, and other configuration settings.
{
"client_id": "client_id_here",
"client_secret": "client_secret_here",
"user_agent": "pc:com.example.myredditapp:v1.2.3",
"client_secrets_file": "youtube_secrets.json file here",
"firefox_profile_path": "FireFox profile path here",
"geckodriver_path": "Absolute path to 'geckodriver' seen in the directory",
"temp_path": "Absolute path to 'temp' (create a folder named temp, copy it's absolute path and paste it here then delete the folder if you want)",
"background_video_path": "mc.mp4",
"video_title": "[post_title] #shorts #questions #redditvideos",
"video_description": "Description goes here.",
"video_tags": ["redditvideos", "questions", "shorts"],
"video_category_id": "22",
"privacy_status": "public",
"window_width": "460",
"window_height": "890",
"scopes": [
"https://www.googleapis.com/auth/youtube.upload"
],
"number_of_posts_to_iterate": "12",
"rounded_corners_radius": "14"
}
-
Set Up the Environment
- Ensure all dependencies are installed.
- Update the
config.json
file with the appropriate credentials and settings.
-
Run the Script
Execute the main script to generate and upload the video:
python main.py
-
Video Output
- The script generates a video compilation of Reddit comments and uploads it to YouTube.
- Ensure that your Reddit and YouTube API credentials are correctly set up and stored in the
config.json
. - Selenium requires a valid Firefox profile and the geckodriver to be set in the config.
- Ensure the
temp
directory path is correct and writable by the script.
Contributions are welcome! Please follow these guidelines when contributing:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Write clear, concise commit messages.
- Ensure the code is well-documented and tested.
- Submit a pull request with a description of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.