--- title: RemoteDownloader emoji: 📈 colorFrom: yellow colorTo: purple sdk: docker pinned: false short_description: 'Experiment for video downloading remotely ' --- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference # 📦 YouTube Premium Downloader API Trình tải video YouTube Premium dành cho mục đích cá nhân/học tập. API cho phép bạn gửi URL và cookie của người dùng để tải video về RAM và trả về link để tải file từ browser. > ⚠️ **Chỉ sử dụng cho mục đích hợp pháp, cá nhân, nghiên cứu. Việc tải video YouTube Premium có thể vi phạm điều khoản dịch vụ của YouTube. Người dùng tự chịu trách nhiệm khi sử dụng dự án này.** --- ## 🚀 Tính năng - Nhận URL video YouTube và cookie Premium từ trình duyệt. - Tải video tốt nhất (video + audio) bằng [`yt-dlp`](https://github.com/yt-dlp/yt-dlp). - Lưu file tạm vào RAM (`/tmp`) trên Hugging Face Spaces. - Trả về link để tải file video từ trình duyệt. - Tự động xóa video sau khi tải về (qua `background_tasks` của FastAPI). --- ## 🛠 Cách deploy lên Hugging Face Spaces ### 1. Tạo Space mới - Loại: **Docker** - Public hoặc Private tùy nhu cầu ### 2. Clone repo hoặc upload code: ```bash git clone https://huggingface.co/spaces// cd # Thêm các file từ dự án này git add . git commit -m "initial commit" git push ``` # 📥 Hướng dẫn kiểm tra cookie và tải video trên máy cá nhân ## 1. Cài đặt yt-dlp Nếu đã có Python: ```bash pip install -U yt-dlp ``` Hoặc tải binary tại: [yt-dlp Installation Guide](https://github.com/yt-dlp/yt-dlp#installation) ## 2. Lấy cookie - Dùng extension [Get cookies.txt](https://chrome.google.com/webstore/detail/get-cookies-txt/) trên trình duyệt đã đăng nhập YouTube Premium. - Lưu file cookie thành `cookies.txt`. ## 3. Chạy lệnh kiểm tra Mở terminal/cmd, chuyển đến thư mục chứa `cookies.txt` và chạy: ```bash yt-dlp --cookies cookies.txt "https://www.youtube.com/watch?v=tcJt-jwpyvs" ``` ## 4. Quan sát kết quả - Nếu tải được → Cookie hợp lệ, IP không bị block. - Nếu báo lỗi cookie hết hạn hoặc không hợp lệ → Lấy lại cookie mới từ trình duyệt. ---