Developed with the software and tools below.
Table of Contents
Auto-yt-shorts is an open-source project designed to automate the process of generating engaging short videos for platforms like YouTube and TikTok. Leveraging AI models and APIs, it enables the effortless creation of video content by suggesting topics, generating voiceovers, adding subtitles, and incorporating stock footage. With features like automatic uploads, background song selection, and parallel execution, auto-yt-shorts offers a valuable solution for content creators seeking a seamless video production workflow.
Note: This project has been created out of curiosity and for educational purposes. It is not intended for commercial use or to infringe on any copyrights, and it is not actively being used to generate AI-generated videos.
The YouTube channel below showcases the auto-yt-shorts project in action, a few examples of the videos generated using the AI model, and the process of uploading them to the platform.
==> QuickQuirks YouTube Channel
Feature | Description | |
---|---|---|
βοΈ | Architecture | The project utilizes a modular architecture with components for video generation, processing, and uploading. It leverages Python environment setup with Docker, FastAPI for web services, and OpenAI for content generation. |
π | Integrations | Key integrations include OAuth 2.0 for YouTube uploads, Pexels for stock videos, OpenAI for content generation, and AssemblyAI for audio processing. External dependencies like scipy and httplib2 enhance functionality. |
𧩠| Modularity | The codebase is modular with distinct modules for metadata, video processing, AI content generation, and upload functionalities. |
β‘οΈ | Performance | Efficiency is maintained through parallel execution for video processing, allowing for faster content generation. The use of Docker containers aids in resource management and scalability of the application. |
π¦ | Dependencies | Key dependencies include oauth2client, FastAPI, OpenAI, and Docker for environment setup and execution. External libraries like pillow and opencv-python enhance image and video processing capabilities. |
βββ auto-yt-shorts/
βββ .github
β βββ workflows
βββ Dockerfile
βββ config.py
βββ docker-compose.yml
βββ environment.yml
βββ example.env
βββ fonts
β βββ bold_font.ttf
βββ main.py
βββ requirements.txt
βββ test.http
βββ upload_video.py
βββ utils
βββ audio.py
βββ llm.py
βββ metadata.py
βββ stock_videos.py
βββ tiktok.py
βββ video.py
βββ yt.py
.
File | Summary |
---|---|
config.py | Defines settings and API keys for controversial topic generation, OpenAI model selection, minimum/maximum search terms, and API keys for Pexels, AssemblyAI, and News API. Creates directories for temporary and output files, background songs, and secondary video content. |
requirements.txt | Manages project dependencies such as OpenAI and FastAPI to facilitate AI video generation, processing, and uploading functionalities within the auto-yt-shorts repository's ecosystem. The file ensures seamless integration of critical libraries for efficient execution of tasks. |
environment.yml | Defines dependencies and environment setup for Python project auto-yt-shorts. Specifies required packages and their versions, ensuring compatibility and consistent development environment for the repository. |
Dockerfile | Builds a Docker container for auto-yt-shorts project, setting up Python environment and executing necessary commands. Copies project files, installs dependencies, and initiates the main script within a Python virtual environment. |
test.http | Generate_videos/. |
upload_video.py | Enables uploading videos to YouTube with OAuth 2.0 authentication and customizable metadata. Implements retry logic and resumable uploads for reliability. Facilitates seamless integration with the parent repositorys video processing workflow. |
docker-compose.yml | Orchestrates Docker containers for the auto-yt-shorts service, configuring volumes and environment variables. Exposes port 8000 for external access. |
main.py | Generates and processes video content based on user input, leveraging parallel execution for efficiency. Handles video metadata, stock footage selection, voiceover generation, and automatic upload to the platform. |
utils
File | Summary |
---|---|
metadata.py | Creates and stores metadata for a video, moving the video file to designated output location and saving metadata in JSON format. |
llm.py | Generates engaging TikTok video ideas, titles, and descriptions based on user input topics. Utilizes OpenAIs language model to suggest captivating content elements in a conversational manner. Enhances creativity in content creation for short-form videos. |
yt.py | Enables automatic and manual video uploads to YouTube. Automatically uploads video with specified details. Prepares videos for manual upload by organizing into folders with relevant metadata. Organized and streamlined YouTube video upload functionalities in the repository architecture. |
tiktok.py | Enables TikTok video uploads using AuthBackend for authentication and upload_video function. Facilitates captioning and customizing upload settings. |
audio.py | Generates voiceovers and selects random background songs for videos using OpenAI API and local files. Provides functionalities for creating audio files and selecting music assets in the auto-yt-shorts repository structure. |
stock_videos.py | Retrieves stock videos based on search terms using Pexels API. Integrates with the parent repositorys architecture via config and video utils. Implements video search and retrieval functionalities for further processing. |
video.py | Generates subtitles and combines videos into a single clip with burnt-in subtitles and background music. Includes functionality to save videos from URLs and add secondary content. |
System Requirements:
- Python:
version 3.12
- Clone the auto-yt-shorts repository:
$ git clone https://github.com/marvinvr/auto-yt-shorts
- Change to the project directory:
$ cd auto-yt-shorts
- Update the environment file:
$ cp example.env .env
Update the
.env
file with your API keys and other credentials.Prefill the
music
andsecondary_video
directories with background music and secondary video content. The tool will automatically select and use these files.Setup and Authenticate with YouTube using the OAuth 2.0 flow:
Follow the instructions in the YouTube Data API documentation to create a project and obtain OAuth 2.0 credentials.
$ python upload_video.py
- Install the dependencies:
$ pip install -r requirements.txt
Run auto-yt-shorts using the command below:
$ python main.py
Start the Docker container using the command below:
$ docker compose up
The application will be accessible at
http://localhost:8000
. You can send a POST request to the/generate_videos
endpoint with the required parameters to generate a video.
Contributions are welcome! Here are several ways you can contribute:
- Report Issues: Submit bugs found or log feature requests for the
auto-yt-shorts
project. - Join the Discussions: Share your insights, provide feedback, or ask questions.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/marvinvr/auto-yt-shorts
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
This project is protected under the MIT License. For more details, refer to the LICENSE file.
- This project was inspired by the MoneyPrinter repository. Some of the code and ideas were adapted from this project.