Automate Creation of YouTube Shorts using AI feedback loops
- The client creates a HTTP request
- The HTTP request generates a set of seed words
- The seed words are used to generate a title
- The title is used to generate a description
- The description is used a generative video prompt
- A YouTube short style video is created and exported to a dedicated folder
- If you want to loop the creation process, start looper.py and a HTTP request will be sent every 2 minutes
illogica-factory
requires Python 3.11 to run effectively. After you finished installing Python, you can install illogica-factory
by following the steps below:
git clone git@github.com:vondas-network/illogica-factory.git
cd illogica-factory
pip install -r requirements.txt
In a nutshell, Python virtual environments help decouple and isolate Python installs and associated pip packages. This allows end-users to install and manage their own set of packages that are independent of those provided by the system or used by other projects.
python3 -m venv env
This will activate your virtual environment. Immediately, you will notice that your terminal path includes env, signifying an activated virtual environment.
source env/bin/activate
See .env.example
for the required environment variables. Once you've added all the necessary data, name the file .env
# See EnvironmentVariables.md for more information.
# Necessary API Keys
# -------------------
# TikTok Session ID
# Obtain your session ID by logging into TikTok and copying the sessionid cookie.
TIKTOK_SESSION_ID=""
# ImageMagick Binary Path
# Download ImageMagick from https://imagemagick.org/script/download.php
IMAGEMAGICK_BINARY=""
# Pexels API Key
# Register at https://www.pexels.com/api/ to get your API key.
PEXELS_API_KEY=""
# Optional API Keys
# -----------------
# OpenAI API Key
# Visit https://openai.com/api/ for details on obtaining an API key.
OPENAI_API_KEY=""
# Cohere API Key
# Visit https://docs.cohere.com/ for details on obtaining an API key.
COHERE_API_KEY=""
# AssemblyAI API Key
# Sign up at https://www.assemblyai.com/ to receive an API key.
ASSEMBLY_AI_API_KEY=""
# Google API Key
# Generate your API key through https://makersuite.google.com/app/apikey
GOOGLE_API_KEY=""
cd Backend
python3 main.py
Send an HTTP request to the route below to begin generating a new YouTube short.
curl --location 'localhost:8080/trigger_route'
python3 looper.py
After starting the program, every 2 minutes an HTTP request will be sent to the already running server.
To use your own music, compress all your MP3 Files into a ZIP file and upload it somewhere. Provide the link to the ZIP file in the Frontend.
It is recommended to use Services such as Filebin to upload your ZIP file. If you decide to use Filebin, provide the Frontend with the absolute path to the ZIP file by using More -> Download File, e.g. (use this Popular TT songs ZIP, not this Popular TT songs)
You can also just move your MP3 files into the Songs
folder.
Add your fonts to the fonts/
folder, and load them by specifying the font name on line 124
in Backend/video.py
.
If you were not able to find your solution, please ask in the discord or create a new issue, so that the community can help you.
Videos from illogica-factory can be found on schwwaaa
- The project is a forked enhancement of Money Printer
You can obtain your TikTok session ID by logging into TikTok in your browser and copying the value of the sessionid
cookie.
Make sure you set your path to the ImageMagick binary correctly in the .env
file, it should look something like this:
IMAGEMAGICK_BINARY="C:\\Program Files\\ImageMagick-7.1.0-Q16\\magick.exe"
Don't forget to use double backslashes (\\
) in the path, instead of one.
If you're having trouble installing playsound
, you can try installing it using the following command:
pip install -U wheel
pip install -U playsound