Universal Video Downloader
by @wwkgit
Universal video downloader supporting multiple platforms (Douyin, Bilibili, YouTube, TikTok, etc.). Can download videos by URL or search by keyword (Douyin s...
clawhub install video-downloader-toolπ About This Skill
name: video-downloader description: Universal video downloader supporting multiple platforms (Douyin, Bilibili, YouTube, TikTok, etc.). Can download videos by URL or search by keyword (Douyin supported). Use when users need to download videos from video platforms.
Universal Video Downloader
A versatile video downloading tool that supports multiple video platforms with intelligent platform detection and multiple download methods.
Supported Platforms
Features
Prerequisites
# Required dependencies
pip install yt-dlp requests DrissionPageFor DrissionPage browser automation
Chrome browser will be auto-downloaded on first use
Usage
Download Single Video
# Douyin
python scripts/video_downloader.py "https://www.douyin.com/video/xxx"Bilibili
python scripts/video_downloader.py "https://www.bilibili.com/video/xxx"YouTube
python scripts/video_downloader.py "https://www.youtube.com/watch?v=xxx"Any other platform
python scripts/video_downloader.py "https://example.com/video"
Batch Download
python scripts/video_downloader.py \
-u "https://www.douyin.com/video/xxx" \
-u "https://www.bilibili.com/video/yyy" \
-u "https://www.youtube.com/watch?v=zzz"
Search and Download (Douyin)
# Search "ηΎε₯³" and download 5 videos
python scripts/video_downloader.py ηΎε₯³ --search --count 5Search with custom count
python scripts/video_downloader.py ηΎε₯³ --search --count 10
Force Browser Mode
For sites with strong anti-crawl protection:
python scripts/video_downloader.py "https://example.com/video" --browser
Specify Output Directory
python scripts/video_downloader.py "URL" --output "D:\\MyVideos"
Parameters
url_or_keyword - Video URL or search keyword--url, -u - Video URL(s), can be used multiple times--search, -s - Enable search mode (for Douyin)--platform, -p - Platform for search (default: douyin)--count, -n - Number of videos to download (default: 5)--output, -o - Output directory (default: D:\video_downloads)--browser, -b - Force use browser mode for downloadingOutput Structure
video_downloads/
βββ single_20240312_121029/
β βββ 001_video_title.mp4
β βββ 001_video_title.json
βββ batch_20240312_121102/
β βββ 001_video1.mp4
β βββ 001_video1.json
β βββ 002_video2.mp4
β βββ 002_video2.json
β βββ _summary.json
βββ douyin_keyword_20240312_121205/
βββ 001_video1.mp4
βββ 001_video1.json
βββ 002_video2.mp4
βββ 002_video2.json
βββ _summary.json
Metadata Format
{
"index": 1,
"title": "Video Title",
"author": "Uploader Name",
"platform": "douyin",
"url": "https://www.douyin.com/video/xxx",
"video_filename": "001_video_title.mp4",
"file_size_mb": 16.84,
"download_time": "2024-03-12T12:20:30"
}
How It Works
Platform Detection
The tool automatically detects the platform from the URL:
douyin.com β Douyinbilibili.com / b23.tv β Bilibiliyoutube.com / youtu.be β YouTubetiktok.com β TikTokDownload Methods
1. yt-dlp (default for most platforms) - Fast and reliable - Supports 1000+ sites - Best for YouTube, Bilibili, etc.
2. DrissionPage (for anti-crawl sites)
- Real browser automation
- Bypasses most anti-crawl protections
- Used automatically for Douyin
- Can be forced with --browser flag
Search Functionality
For Douyin search: 1. Opens browser and navigates to search page 2. Extracts video links from search results 3. Downloads each video using browser session
Troubleshooting
"yt-dlp not installed"
pip install yt-dlp
"DrissionPage not installed"
pip install DrissionPage
Download fails for specific site
Try forcing browser mode:
python video_downloader.py "URL" --browser
Chrome not found (DrissionPage)
DrissionPage will auto-download Chrome on first use. If it fails: 1. Install Chrome manually 2. Or set Chrome path in DrissionPage config
Connection errors
Some sites may block automated access. Try:
--browser modeNotes
Dependencies
License
This tool is for educational and personal use only. Respect the terms of service of video platforms.
π‘ Examples
Download Single Video
# Douyin
python scripts/video_downloader.py "https://www.douyin.com/video/xxx"Bilibili
python scripts/video_downloader.py "https://www.bilibili.com/video/xxx"YouTube
python scripts/video_downloader.py "https://www.youtube.com/watch?v=xxx"Any other platform
python scripts/video_downloader.py "https://example.com/video"
Batch Download
python scripts/video_downloader.py \
-u "https://www.douyin.com/video/xxx" \
-u "https://www.bilibili.com/video/yyy" \
-u "https://www.youtube.com/watch?v=zzz"
Search and Download (Douyin)
# Search "ηΎε₯³" and download 5 videos
python scripts/video_downloader.py ηΎε₯³ --search --count 5Search with custom count
python scripts/video_downloader.py ηΎε₯³ --search --count 10
Force Browser Mode
For sites with strong anti-crawl protection:
python scripts/video_downloader.py "https://example.com/video" --browser
Specify Output Directory
python scripts/video_downloader.py "URL" --output "D:\\MyVideos"
βοΈ Configuration
# Required dependencies
pip install yt-dlp requests DrissionPageFor DrissionPage browser automation
Chrome browser will be auto-downloaded on first use