🤖 Automatically generate YouTube shorts simply by running the script!
From creation to editing and voiceover too, this script automates it all for a YouTube short. No more tedious tasks or endless hours, this script has you covered! And the best part? It's absolutely free!
- OpenAI API Key - Get it from the Open AI Website. It provides $18 of free credits by default and they are more than enough. [OPTIONAL]
- OpenAI -
pip install openai
- gTTS -
pip install gtts
- MoviePY -
pip install moviepy
- Dotenv -
pip install python-dotenv
- Download this repository as a zip file or clone it using git.
- Open the folder.
- Make sure the above-mentioned modules are installed:
pip install -r requirements.txt
- Add your OpenAI API key to the
.env.example
file (OPENAI_API=<key>
) and rename it to.env
[OPTIONAL] - Download both gameplay videos from Google Drive (as they were too large to upload to GitHub)
- Put both videos in a folder named "
gameplay
" in the directory with theshorts.py
file. - Run the
shorts.py
Python file.
To use this script:
- Run the
shorts.py
Python file. - Enter the name of the video.
- Let AI generate video content for you or enter it yourself.
- NOTE : (Make sure you have added your OpenAI API key in the
.env
file if using AI to generate content)
- NOTE : (Make sure you have added your OpenAI API key in the
- And that's it! Everything else will be handled automatically!
- You can find your video in the
generated/
directory.
Click Here To See The Demo Video
- NOTE : This video is trimmed but it shouldn't take more than 1 minute to generate your video.
The script starts by taking the video name and asking if the user wants to generate content using AI (which can be edited later).
After the content is generated/entered by the user, it generates Text-to-Speech and saves the file as speech.mp3
.
The editing starts by selecting a gameplay, trimming a random part of it, and adding speech on top of it. Next, it resizes the video to a 9:16 aspect ratio and saves the final video.
Note that this script is very basic as of now and does not generate any graphics like images or even subtitles. These are some things that may be added in the future. If you want to contribute, you are free to do so. Feel free to fork and improve this repository.
Due to school, exams, and other real-life commitments, I don't get much time to work on this project. When I do, I would like to add the above-mentioned features. Maybe even a Reddit video maker, but I'm not sure yet.
Beep boop, boop beep. I am a script. If there are any issues, contact my [Creator](https://github.com/Binary-Bytes) - BedrockGranny#8331 or bedrockgranny on Discord.
- OpenAI API - For generating video content.
- gTTS - For Text-to-Speech.
- MoviePY - For video editing.