Skip to content

ecnivs/crank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

65 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

crank

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)
  • ffmpeg and ffprobe installed 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 name
  • PROMPT: Topic or idea to base the generated video on
  • UPLOAD: true or false to enable/disable uploads
  • DELAY: Number of hours between uploads: 0 for instant upload, or any positive number to schedule the video that many hours later (defaults to 2.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 to small)
  • OAUTH_PATH: Path to OAuth credentials (defaults to secrets.json)
  • FONT: Defines text font (defaults to Comic Sans MS)

Default settings in config/prompt.yml

  • GET_CONTENT: Guidelines for generating the transcript
  • GET_TITLE: Guidelines for generating the title
  • GET_SEARCH_TERM: YouTube search term used for background video scraping
  • GET_DESCRIPTION: Guidelines for generating the description
  • GET_CATEGORY_ID: Guidelines for generating Category ID for the video

πŸ“¦ Installation

  1. Clone the repository
git clone https://github.com/ecnivs/crank.git
cd crank
  1. Install uv
pip install uv
  1. Install dependencies using uv
uv sync
  1. 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
  1. Install spaCy language model
uv run python -m spacy download en_core_web_md

πŸš€ 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

example.mp4

πŸ’– 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.

Buy Me A Coffee

πŸ§ͺ 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:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Submit a pull request

I'd appreciate any feedback or code reviews you might have!