The project includes a GitHub Actions workflow that runs daily at 7:00 AM UTC. It:
- Generates lesson scripts using Gemini.
- Produces long-form and short YouTube videos.
- Uploads them automatically with appropriate thumbnails and metadata.
gemini-youtube-automation/
├── .github/
│ └── workflows/
│ └── main.yml # GitHub Actions workflow configuration
├── src/ # Source directory for Python modules
│ ├── init.py # Initializes the 'src' package
│ ├── generator.py # Code for generating content and video
│ └── uploader.py # Code for uploading to YouTube
├── .gitignore # Files and directories to ignore in version control
├── content_plan.json # Contains topics for moving forward.
├── main.py # Main entry point to run the application
└── requirements.txt # List of Python packages needed
-
Clone the repository and open a terminal in the project root (the folder that contains
main.py). -
Install dependencies (Python 3 recommended):
pip install -r requirements.txt
-
Environment variables
GOOGLE_API_KEY(required): Google AI / Gemini API key.PEXELS_API_KEY(optional): If unset, slide backgrounds fall back to solid colors.
-
YouTube upload (local)
- Create a YouTube Data API OAuth Desktop app client in Google Cloud and download the JSON as
client_secrets.jsonin the project root. - On the first run, the app opens a browser to complete OAuth and writes
credentials.jsonfor later runs.
- Create a YouTube Data API OAuth Desktop app client in Google Cloud and download the JSON as
From the project root, with GOOGLE_API_KEY set (and optionally PEXELS_API_KEY):
python main.pyOn Windows, if python is not on your PATH, try py main.py.
This loads or creates content_plan.json, produces up to one pending lesson (long + short video), uploads to YouTube, updates lesson status, and writes artifacts under output/. Ensure FFmpeg is available if MoviePy or audio conversion fails on your system.
The repo is intended to run on a daily schedule (for example 7:00 AM UTC) via a workflow under .github/workflows/ (for example main.yml). Typical setup:
- Add repository secrets for
GOOGLE_API_KEYand, if you use stock imagery,PEXELS_API_KEY. - Provide YouTube credentials in CI the same way your workflow expects (for example writing
client_secrets.jsonand/orcredentials.jsonfrom secrets beforepython main.py), sosrc/uploader.pycan refresh tokens non-interactively. - Push to the branch your workflow uses (usually
main); use Actions → Run workflow if the workflow definesworkflow_dispatchfor manual runs.
Adjust steps to match your actual workflow file once it is committed.