Skip to main content

AI-powered command-line tool for downloading videos from YouTube and other platforms

Project description

ClipGenius ๐ŸŽฌ๐Ÿค–

AI-powered command-line tool for downloading videos from YouTube and other platforms with conversational assistance.

Features

  • ๐ŸŽฏ AI-Powered Interactions: Conversational assistant that guides you through the download process
  • ๐Ÿ“ฑ Multi-Platform Support: Works with YouTube, Vimeo, and many other video platforms via yt-dlp
  • ๐ŸŽต Flexible Downloads: Choose between video+audio, audio-only, or specific formats
  • ๐Ÿ“Š Smart Analysis: Get video metadata, duration, quality options before downloading
  • ๐ŸŽจ Subtitle & Thumbnail Support: Download subtitles and thumbnails alongside videos
  • ๐Ÿ”ง Error Handling: AI-powered troubleshooting suggestions when downloads fail
  • ๐ŸŽช Interactive CLI: Beautiful, colorful command-line interface
  • ๐Ÿ”„ Batch Processing: Download multiple videos from URL lists or web pages
  • ๐Ÿท๏ธ Smart Filenames: AI-suggested custom filenames based on video content

Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)

Install from Source (Development)

# Clone the repository
git clone https://github.com/alexusa404-creator/Clipgenius.git
cd Clipgenius

# Install in editable mode with all dependencies
pip install -e .

Using virtual environment (recommended)

# Create virtual environment
python -m venv clipgenius-env

# Activate virtual environment
# On Windows:
clipgenius-env\Scripts\activate
# On macOS/Linux:
source clipgenius-env/bin/activate

# Install ClipGenius
pip install -e .

Install from Package (Future)

Once published to PyPI, you'll be able to install directly:

pip install clipgenius

Configuration

OpenAI API Key (Optional but Recommended)

For AI-powered conversational features, you'll need an OpenAI API key:

  1. Get your API key from OpenAI
  2. Set it as an environment variable:
# Linux/macOS
export OPENAI_API_KEY="your-api-key-here"

# Windows
set OPENAI_API_KEY=your-api-key-here
  1. Or create a .env file (copy from .env.example):
OPENAI_API_KEY=your-api-key-here

Note: ClipGenius works without an API key, but you'll miss the AI conversational features.

Usage

Basic Usage

# Interactive mode with AI assistance
clipgenius "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# Quick download without AI interaction
clipgenius "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --no-ai

# Audio only download
clipgenius "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --audio-only

# Custom download directory
clipgenius "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --download-path ~/Videos

# Batch download from file
clipgenius --batch urls.txt

# Batch download from webpage (extract video URLs)
clipgenius --batch "https://example.com/video-page" --batch-webpage

Advanced Options

# Specify video quality
clipgenius "URL" --quality 720p

# Run as Python module
python -m clipgenius "URL"

# Get help
clipgenius --help

Interactive Experience

When you run ClipGenius in interactive mode, it will:

  1. ๐Ÿค– Greet you and analyze your URL
  2. ๐Ÿ“Š Show video details (title, duration, channel, etc.)
  3. ๐ŸŽฏ Ask about preferences (quality, format, subtitles, etc.)
  4. ๐Ÿ“บ Display available formats (if requested)
  5. ๐Ÿš€ Download your video with progress feedback
  6. ๐ŸŽ Offer additional resources (subtitles, thumbnails)

Examples

Example 1: YouTube Video with AI

$ clipgenius "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘            ๐ŸŽฌ ClipGenius ๐Ÿค–            โ•‘
โ•‘    AI-Powered Video Download Tool     โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ‘‹ Hello! I'm ClipGenius, your AI assistant for video downloads!

I can see you want to download from YouTube. Let me analyze this video for you...

๐ŸŽฌ Video Analysis
==================================================
๐Ÿ“น "Rick Astley - Never Gonna Give You Up" by Rick Astley
โฑ๏ธ  Duration: 3m 33s | ๐Ÿ‘€ 1.4B views

This classic 80s hit has become an internet phenomenon! Ready to download this timeless track?

โ“ Video or audio only? (video/audio) video
โ“ Quality preference? (best/720p/480p/360p/worst) 720p
โ“ Download subtitles? (yes/no) yes
โ“ Download thumbnail? (yes/no) yes
โ“ Custom filename? (leave blank for default) 

โœ… Download completed successfully!
โœ… Subtitles downloaded!
โœ… Thumbnail downloaded!

Example 2: Quick Audio Download

$ clipgenius "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --audio-only --no-ai

๐ŸŽต Quick audio download completed!
๐Ÿ“ Saved to: ./downloads/

Example 3: Batch Download from File

Create a file videos.txt:

https://www.youtube.com/watch?v=dQw4w9WgXcQ
https://www.youtube.com/watch?v=9bZkp7q19f0
https://youtu.be/jNQXAC9IVRw

Then run:

$ clipgenius --batch videos.txt

๐Ÿ”„ Batch Download Mode
==================================================
โœ… Found 3 video URLs:
  1. https://www.youtube.com/watch?v=dQw4w9WgXcQ
  2. https://www.youtube.com/watch?v=9bZkp7q19f0
  3. https://youtu.be/jNQXAC9IVRw

๐Ÿ“‹ Batch Download Preferences
==================================================
โ“ Download all as audio only? (yes/no) no
โ“ Quality for all videos? (best/720p/480p/etc.) 720p
โ“ Download subtitles for all? (yes/no) yes
โ“ Download thumbnails for all? (yes/no) no

๐ŸŽ‰ Batch Download Complete!
==================================================
โœ… Successful: 3
โŒ Failed: 0

Example 4: Extract Videos from Webpage

$ clipgenius --batch "https://example.com/playlist-page" --batch-webpage

๐Ÿ” Extracting video URLs from webpage...
โœ… Found 5 video URLs from the webpage!

Supported Platforms

ClipGenius uses yt-dlp under the hood, supporting 1000+ websites including:

  • YouTube
  • Vimeo
  • Twitch
  • TikTok
  • Instagram
  • Twitter
  • Facebook
  • And many more!

Project Structure

clipgenius/
โ”œโ”€โ”€ __init__.py          # Package initialization
โ”œโ”€โ”€ __main__.py          # Entry point for python -m clipgenius
โ”œโ”€โ”€ cli.py               # Command-line interface and main logic
โ”œโ”€โ”€ ai_agent.py          # AI conversational assistant
โ”œโ”€โ”€ downloader.py        # Video downloading logic (yt-dlp wrapper)
โ”œโ”€โ”€ batch.py             # Batch processing and web scraping
โ””โ”€โ”€ utils.py             # Utility functions

Development

Running Tests

# Install development dependencies
pip install -e ".[dev]"

# Run tests (when available)
python -m pytest

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

Publishing to PyPI

For maintainers who want to publish this package to PyPI, see PUBLISHING.md for detailed instructions.

Troubleshooting

Common Issues

  1. "No OpenAI API key found"

    • Set the OPENAI_API_KEY environment variable
    • Or use --no-ai flag to skip AI features
  2. "Could not extract video information"

    • Check if the URL is correct and accessible
    • Some videos might be region-restricted or private
    • Try updating yt-dlp: pip install --upgrade yt-dlp
  3. Permission errors when downloading

    • Make sure you have write permissions to the download directory
    • Try using a different download path with --download-path

Getting Help

  • Check the output of clipgenius --help
  • Look at the error messages - ClipGenius provides helpful suggestions
  • Open an issue on GitHub if you encounter bugs

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • yt-dlp for the robust video downloading backend
  • OpenAI for the conversational AI capabilities
  • Click for the command-line interface framework
  • BeautifulSoup for web scraping functionality

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clipgenius-1.0.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clipgenius-1.0.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file clipgenius-1.0.0.tar.gz.

File metadata

  • Download URL: clipgenius-1.0.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for clipgenius-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7870943ffac1208a433caa6f4078587320d690278dadd17dcccbbfd59969f312
MD5 4779f0aa03ef9129a2a8d57e7d387bd5
BLAKE2b-256 1e8d5da446bbcf525b1aca8a57e4ce4f47ca4149f176ae1e451cc9026ee62d05

See more details on using hashes here.

File details

Details for the file clipgenius-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: clipgenius-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for clipgenius-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4cd6a4faa5d1cee1cf9da3d264f80c802704a0614ad54f06876f6d57146c76d5
MD5 408d667fd39f4e45fcc0824495b63978
BLAKE2b-256 20e1cc4300cf21eb06c3b59be14694913a5ba2cd18e0b0e0373113e2f933a876

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page