Tải video, audio, playlist, subtitle, thumbnail từ 1000+ nền tảng bằng yt-dlp. Sau khi tải tự động gửi file về Telegram nếu dung lượng <= 50MB.
Trước khi dùng, chạy script cài đặt để kiểm tra và cài đầy đủ dependencies:
powershell
powershell -ExecutionPolicy Bypass -File scripts/install.ps1
Script sẽ tự động:
Chỉ cần paste URL vào chat là xong:
text
https://www.youtube.com/watch?v=...
https://www.tiktok.com/@user/video/...
https://www.facebook.com/reel/...
Agent sẽ tự tải về + gửi vào Telegram.
Có thể yêu cầu cụ thể hơn:
Chạy scripts/check.ps1 để verify yt-dlp và ffmpeg có sẵn. Nếu thiếu, chạy scripts/install.ps1.
Thu thập từ user (nếu không có thì dùng default):
Tham sốDefaultTùy chọnURL(bắt buộc)-Loại tảivideovideo / audio / playlist / subtitle / thumbnailChất lượngbestbest / 1080p / 720p / 480p / 360pFormatmp4 (video), mp3 (audio)mp4 / webm / mkv / mp3 / m4aThư mục lưuDownloads\yt-dlp\bất kỳ đường dẫn nào
Xem references/commands.md để lấy lệnh đúng cho từng use case.
Lệnh cơ bản nhất (video best quality):
powershell
$PYTHON = scripts/find-python.ps1 # tự detect Python path
& $PYTHON -m yt_dlp `
-f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" `
--merge-output-format mp4 `
-o "$env:USERPROFILE\Downloads\yt-dlp\%(title)s.%(ext)s" `
"<URL>"
Sau khi tải xong:
powershell
$file = Get-ChildItem "$env:USERPROFILE\Downloads\yt-dlp\" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
$sizeMB = [math]::Round($file.Length / 1MB, 2)
File <= 50MB:
$env:USERPROFILE\.openclaw\workspace\tmp_send.<ext>message tool: action=send, filePath=workspace path, caption="✅ {title} ({sizeMB}MB)"File > 50MB: Báo user "File {sizeMB}MB vượt giới hạn 50MB của Telegram. Đã lưu tại: {path}"
Nếu lỗi khi gửi: thông báo lỗi + đường dẫn file trên máy
Xem references/platforms.md để biết danh sách đầy đủ và lưu ý riêng cho từng nền tảng.
Các nền tảng phổ biến: YouTube, TikTok, Facebook, Instagram, Twitter/X, Twitch, Vimeo, SoundCloud, Reddit, Bilibili, Dailymotion, Pinterest, LinkedIn...
Xem references/troubleshooting.md để xử lý các lỗi thường gặp:
--cookies-from-browser chrome--sleep-interval 3 --max-sleep-interval 8python -m pip install -U yt-dlp