crank
crank copied to clipboard
Dogfood Youtube Shorts Generator written in Olive
Overview
Crank takes a topic and generates a complete YouTube Short, including video and metadata, ready for upload. Designed for fast, efficient content creation with full control over the output.
Prerequisites
- Python 3.x (Tested with Python 3.13)
uv(Python package manager)ffmpegandffprobeinstalled and available in your system PATH (required for video processing)
Environment Variables
Crank uses a .env file to load sensitive keys and config values.
Make sure to create a .env file in the root directory containing your API keys, for example:
GEMINI_API_KEY=your_api_key_here
Credential Files
The other credentials are stored as JSON files inside the root directory:
secrets.json— OAuth 2.0 client credentials JSON used for YouTube API upload authentication
Customization
Crank is fully configurable. You can adjust prompts, upload behavior, and other settings using your preferred method.
Default settings in config/preset.yml
Change the following directly in the file:
NAME: The channel namePROMPT: Topic or idea to base the generated video onUPLOAD:trueorfalseto enable/disable uploadsDELAY: Number of hours between uploads:0for instant upload, or any positive number to schedule the video that many hours later (defaults to2.5)GEMINI_API_KEY: Optional channel-specific API key (overrides .env if set)WHISPER_MODEL: Preferred whisper model (tiny,base,small,medium,large-v1,large-v2,large-v3; defaults tosmall)OAUTH_PATH: Path to OAuth credentials (defaults tosecrets.json)FONT: Defines text font (defaults toComic Sans MS)
Default settings in config/prompt.yml
GET_CONTENT: Guidelines for generating the transcriptGET_TITLE: Guidelines for generating the titleGET_SEARCH_TERM: YouTube search term used for background video scrapingGET_DESCRIPTION: Guidelines for generating the descriptionGET_CATEGORY_ID: Guidelines for generating Category ID for the video
Installation
- Clone the repository
git clone https://github.com/ecnivs/crank.git
cd crank
- Install
uv
pip install uv
- Install dependencies using
uv
uv sync
- Download
spaCymodel
uv run python -m spacy download en_core_web_md
- Install
ffmpeg
# Debian / Ubuntu
sudo apt install ffmpeg
# Arch Linux
sudo pacman -S ffmpeg
# macOS (Homebrew)
brew install ffmpeg
# Windows (using Chocolatey)
choco install ffmpeg
Running Crank
Run the tool with the default configuration
uv run main.py
Or provide your custom config file with --path
uv run main.py --path path/to/your_config.yml
Example Output
https://github.com/user-attachments/assets/69b1dc3d-79f2-4a6f-bde1-da6c07e32185
Support the project
If you find Crank helpful and want to support its development, donations are welcome! Your support helps keep the project active and enables new features.
Testing
For information about running tests, see TESTING.md.
Plugin Development
For information about creating custom background video plugins, see PLUGIN_GUIDE.md.
Contributing
Feel free to:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Submit a pull request
