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:
- Get your API key from OpenAI
- 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
- Or create a
.envfile (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:
- ๐ค Greet you and analyze your URL
- ๐ Show video details (title, duration, channel, etc.)
- ๐ฏ Ask about preferences (quality, format, subtitles, etc.)
- ๐บ Display available formats (if requested)
- ๐ Download your video with progress feedback
- ๐ 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
- 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
-
"No OpenAI API key found"
- Set the OPENAI_API_KEY environment variable
- Or use
--no-aiflag to skip AI features
-
"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
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7870943ffac1208a433caa6f4078587320d690278dadd17dcccbbfd59969f312
|
|
| MD5 |
4779f0aa03ef9129a2a8d57e7d387bd5
|
|
| BLAKE2b-256 |
1e8d5da446bbcf525b1aca8a57e4ce4f47ca4149f176ae1e451cc9026ee62d05
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cd6a4faa5d1cee1cf9da3d264f80c802704a0614ad54f06876f6d57146c76d5
|
|
| MD5 |
408d667fd39f4e45fcc0824495b63978
|
|
| BLAKE2b-256 |
20e1cc4300cf21eb06c3b59be14694913a5ba2cd18e0b0e0373113e2f933a876
|