Mệt mỏi vì phải sao chép và dán lệnh hoài? 🤔 Tải miễn phí PDF của chúng tôi: YT-DLP Cheat-Sheet – 50 lệnh YT-DLP hữu ích.
Trong hướng dẫn YT-DLP này, chúng ta sẽ tìm hiểu yt-dlp là gì và cách tải về cũng như cài đặt nó trên máy tính Windows hoặc Linux của bạn.
Chúng ta cũng sẽ đề cập đến các thành phần cần thiết, bao gồm cả FFmpeg, và hướng dẫn cách sử dụng yt-dlp để tải video.

Tài liệu này đã được phát triển nghiêm ngặt cho mục đích thông tin. Nó không cấu thành sự chứng thực cho bất kỳ hoạt động nào (bao gồm cả các hoạt động bất hợp pháp), sản phẩm hoặc dịch vụ. Bạn hoàn toàn chịu trách nhiệm tuân thủ luật hiện hành, bao gồm luật sở hữu trí tuệ, khi sử dụng dịch vụ của chúng tôi hoặc dựa vào bất kỳ thông tin nào ở đây. Chúng tôi không chấp nhận bất kỳ trách nhiệm pháp lý nào đối với thiệt hại phát sinh từ việc sử dụng các dịch vụ hoặc thông tin của chúng tôi ở đây dưới bất kỳ hình thức nào, trừ khi luật pháp yêu cầu rõ ràng.
Mục lục.
- YT-DLP là gì?
- Làm cách nào để tải xuống và cài đặt YT-DLP?
- Cài đặt phụ thuộc: FFmpeg và FFProbe
- Cách sử dụng YT-DLP trong Windows và Linux.
- Sử dụng nâng cao cho Plugin YT-DLP.
- YT-DLP: Ưu và nhược điểm
- yt-dlp vs youtube-dl: Những điểm khác biệt chính
- Câu hỏi thường gặp: YT-DLP
- Lời kết
1. Trình tải youtube video YT-DLP là gì?
YT-DLP is a free and open-source software project created (as a fork) from the now-discontinued project, youtube-dlc. yt-dlp is based on the popular YouTube downloader, youtube-dlc, but now comes with additional features and improvements. This software is basically used to download videos from YouTube, Vimeo, and other similar websites.
Việc tải xuống và cài đặt yt-dlp tương đối dễ dàng, nhưng để sử dụng thành thạo công cụ này có thể mất một chút thời gian. YT-DLP là một công cụ dòng lệnh được sử dụng trên các hệ điều hành Windows, macOS và Linux. Việc không có giao diện đồ họa “đẹp mắt” khiến nhiều người e ngại, tuy nhiên đây lại là trình tải video YouTube mạnh mẽ nhất hiện nay.
Các tính năng chính của YT-DLP là gì?
- Tùy chọn mạng: Thay đổi cách YT-DLP giao tiếp với mạng. Điều này bao gồm các tùy chọn như đặt proxy, điều chỉnh giá trị thời gian chờ và chỉ định chuỗi tác động người dùng.
- Bỏ qua giới hạn địa lý: Tính năng này cho phép bạn bỏ qua các giới hạn địa lý có thể ngăn bạn truy cập các video cụ thể dựa trên vị trí. Bạn có thể sử dụng các tùy chọn YT-DLP với VPN hoặc proxy để vượt qua những hạn chế này.
- Lựa chọn video: Với YT-DLP, bạn có thể chọn video bạn muốn tải xuống từ danh sách phát hoặc kênh. Ngoài ra, bạn cũng có thể tải xuống toàn bộ danh sách phát và kênh.
- Tùy chọn tải xuống video: Tính năng này cho phép bạn kiểm soát quá trình tải xuống. Ví dụ: bạn có thể chọn chỉ tải xuống âm thanh, chỉ video hoặc cả hai. Bạn cũng có thể đặt giới hạn chất lượng video và tốc độ tải xuống.
- Tùy chọn hệ thống tệp cho video: Với tính năng này, bạn có thể chỉ định thư mục đầu ra và các mẫu tên tệp cho các video đã tải xuống.
- Hình ảnh thu nhỏ cho video: Tải xuống hình ảnh thu nhỏ cho video cùng với chính video đó. Bạn thậm chí có thể chỉ định định dạng và kích thước hình ảnh.
- Cách giải quyết: Tính năng này cung cấp nhiều cách xử lý khác nhau cho các sự cố phát sinh trong quá trình tải xuống. Ví dụ, bạn có thể bỏ qua việc xác minh chứng chỉ SSL bằng cách sử dụng tuỳ chọn --no-check-certificate.
- Tự động thử lại khi tải xuống video không thành công. Theo mặc định, YT-DLP sẽ thực hiện ba lần thử tải xuống video trước khi từ bỏ và chuyển sang video tiếp theo. Bạn cũng có thể định cấu hình số lần thử lại tải xuống video này.
- Tùy chọn định dạng video: YT-DLP cho phép bạn chọn định dạng video bạn muốn tải xuống, chẳng hạn như MP4, WebM hoặc FLV. Bạn cũng có thể đặt chất lượng và độ phân giải của video.
- Tính năng phụ đề: Tùy chọn YT-DLP này cho phép bạn tải xuống phụ đề (nhúng chúng) cùng với video. Bạn có thể chỉ định định dạng phụ đề và ngôn ngữ.
- Tùy chọn xác thực: Bạn có thể xác thực với một số trang web như YouTube hoặc Vimeo bằng cách sử dụng các tuỳ chọn như tên người dùng và mật khẩu hoặc API key.
- Tùy chọn xử lý hậu kỳ cho video: Thực hiện các tác vụ xử lý hậu kỳ khác nhau đối với các video đã tải xuống, chẳng hạn như hợp nhất hoặc chia nhỏ các tệp video, thêm siêu dữ liệu hoặc chuyển đổi video sang định dạng khác.
- Tích hợp với SponsorBlock: Tính năng này cho phép bạn đánh dấu/xóa các phần của nhà tài trợ trong video YouTube thông qua API SponsorBlock.
| 🍿 Thông tin thú vị: Bạn có thể tự động hóa việc tải hàng loạt video bằng yt-dlp trên seedbox bằng cách kết hợp danh sách URL, tệp lưu trữ download và một script theo lịch trình (qua cron hoặc Task Scheduler). Với quyền root (có trong các gói cao cấp của RapidSeedbox), seedbox của bạn có thể tự động lấy, xử lý và lưu trữ video mới 24/7 — hoàn toàn không cần can thiệp thủ công. Quá hoàn hảo để xây dựng kho phát video riêng tư của bạn! |
2. Làm cách nào để tải xuống và cài đặt YT-DLP?
- Truy cập kho lưu trữ GitHub chính thức của YT-DLP: https://github.com/yt-dlp/yt-dlp
- Cuộn xuống cuối trang nơi có thể nhìn thấy nút tải xuống. Đây là liên kết (neo) nội bộ sẽ đưa bạn đến: https://github.com/YT-DLP/YT-DLP#installation.

- Trên trang cài đặt này, cuộn xuống và tìm các tệp phát hành mới nhất. Định vị các tệp thực thi, YT-DLP (nhập nhị phân nhập zip được khuyến nghị cho Linux hoặc BSD), YT-DLP.exe (dành cho Windows) hoặc YT-DLP_macOS (dành cho Windows). Nếu hệ điều hành của bạn không hỗ trợ bất kỳ tệp phát hành nào trong số này, hãy cuộn xuống trang này 'các lựa chọn thay thế' để tìm thêm tùy chọn.
- Chọn nền tảng hoặc Hệ điều hành của bạn và tải xuống tệp phát hành thích hợp.

a. Tải xuống và cài đặt YT-DLP trên Windows.
- Để minh họa, chúng ta sẽ tải xuống và chạy yt-dlp.exe trên Windows Server 2022.
- Sau khi tải xuống, hãy kiểm tra kích thước, phiên bản và nhà phát hành của tệp. Hãy xem ảnh chụp màn hình bên dưới.

Lưu ý: Tệp yt-dlp.exe không phải là trình cài đặt; nó là tệp thực thi của chính yt-dlp. Trong ngữ cảnh của Windows, một tệp thực thi (với phần mở rộng .exe) là một chương trình có thể chạy trực tiếp khi bạn nhấp vào hoặc thực thi từ dòng lệnh. Đối với yt-dlp, bạn chỉ cần đặt tệp yt-dlp.exe vào một thư mục tuỳ chọn (ví dụ: C:\ytdlp) và chạy trực tiếp từ đó.
b. Tải xuống và cài đặt YT-DLP trong Linux (Ubuntu).
- Vì mục đích minh họa, chúng tôi sẽ tải xuống và cài đặt bản phát hành YT-DLP mới nhất trong Ubuntu 22.04. Đảm bảo máy Ubuntu của bạn được cập nhật.
- Lệnh sau tải xuống bản phát hành mới nhất của chương trình YT-DLP từ GitHub và cài đặt nó trong thư mục /usr/local/bin với tên tệp YT-DLP.
|
1 |
$ sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp |

- Lệnh sau đặt quyền của tệp yt-dlp trong thư mục /usr/local/bin để cho phép tất cả người dùng (chủ sở hữu, nhóm và những người khác) đọc và thực thi tệp.
|
1 |
$ sudo chmod a+rx /usr/local/bin/yt-dlp |
- Lệnh này là cần thiết để cho phép người dùng chạy lệnh yt-dlp từ dòng lệnh.

c. Cách cập nhật yt-dlp lên phiên bản mới nhất
Giữ cho yt-dlp luôn được cập nhật giúp bạn có được các tính năng mới nhất, bản sửa lỗi và hỗ trợ các trang web mới.
- Lệnh cập nhật đơn giản Nếu bạn đang sử dụng bản phát hành dạng tệp thực thi (binary), chỉ cần chạy:
|
1 |
yt-dlp -U |
- Nếu đã cài đặt qua pip: Chạy lại lệnh cài đặt sau:
|
1 |
python3 -m pip install -U yt-dlp |
- Chuyển sang bản Nightly (Khuyến nghị để có bản sửa lỗi mới nhất): Để nâng cấp từ bản ổn định lên bản phát hành nightly:
|
1 |
yt-dlp --update-sang nightly |
- Đối với người dùng pip: python3 -m pip install -U –pre “yt-dlp[default]”
| 🔧 Bạn cũng có thể sử dụng --update-to để chuyển sang một kênh phát hành khác (như master) hoặc thậm chí là một thẻ phiên bản cụ thể. |
3. Cài đặt phụ thuộc: FFmpeg và FFProbe
Trước khi tiếp tục với yt-dlp, bạn nên cài đặt FFmpeg và FFprobe. Có các phụ thuộc 'tùy chọn' khác liên quan đến mạng, siêu dữ liệu và linh tinh, nhưng FFmpeg và FFProbe gần như là "bắt buộc"
- FFmpeg là một khung đa phương tiện để xử lý video, âm thanh và các tệp đa phương tiện khác. Nó được YT-DLP sử dụng để thực hiện các hoạt động đa phương tiện khác nhau, bao gồm hợp nhất các định dạng khác nhau của tệp video hoặc âm thanh. Không có nó, YT-DLP sẽ không thể hợp nhất các định dạng được yêu cầu. Chẳng hạn, bạn có thể tải xuống video 1080p không có âm thanh.
- FFProbe là công cụ dòng lệnh đi kèm với FFmpeg. FFProbe được sử dụng để phân tích và trích xuất thông tin từ các tệp đa phương tiện như video và âm thanh. YT-DLP cần sử dụng FFProbe để trích xuất siêu dữ liệu từ các tệp đa phương tiện như video đang được tải xuống. Siêu dữ liệu này bao gồm thông tin như codec video hoặc âm thanh, độ phân giải, thời lượng, tốc độ bit và các chi tiết kỹ thuật khác về tệp đa phương tiện. Nếu không có FFprobe, YT-DLP sẽ không thể trích xuất siêu dữ liệu này và một số tính năng của nó có thể không hoạt động chính xác.

- Trước khi cài đặt FFmpeg và FFProbe, hãy đảm bảo rằng máy của bạn đã được cập nhật.
a. Cài đặt FFmpeg và FFprobe trên Linux.
Để cài đặt FFmpeg trên máy Linux (Ubuntu 22.04), hãy sử dụng lệnh sau:
|
1 |
$ sudo apt install ffmpeg |
- Để kiểm tra cài đặt và phiên bản hiện tại, hãy sử dụng lệnh sau:
|
1 |
$ ffmpeg -version |

Cài đặt FFprobe ư? FFprobe xuất hiện khi bạn cài đặt gói FFmpeg. Không cần cài đặt bổ sung cho FFprobe. Để kiểm tra xem FFprobe đã được cài đặt hay chưa, hãy đưa ra lệnh “ffprobe”

b. Cài đặt FFmpeg và FFprobe trên Windows
- Truy cập https://ffmpeg.org/ và tải xuống gói (tệp .EXE) cho Windows. Bản dựng phát hành thường ổn định hơn bản dựng Git Master, được phát hành thường xuyên hơn
- Chọn bản phát hành của bạn, tải xuống tệp 7z hoặc zip và giải nén

- Tải xuống gói và lưu nó ở bất cứ đâu bạn muốn.
- Chúng tôi đã tạo một thư mục mới có tên là “PATH_Programs-ytdpl”, nơi chúng tôi sẽ di chuyển và giải nén gói FFmpeg.
- Trong ffmpeg-(tên của tệp) > bin > bạn sẽ thấy ba công cụ: ffmpeg, ffplay và ffprobe. Di chuyển (giải nén) ba ứng dụng vào thư mục mới của bạn.

- Ghi lại đường dẫn (ví dụ: C:\PATH_PrograTrong Biến môi trường, bên dưới “Biên người dùng cho quản trị viên”, chọn Đường dẫn (1) > sau đó nhấp vào “Chỉnh sửa”.ms -ytdlp) và chuyển đến “Chỉnh sửa các biến môi trường hệ thống”. Tiện ích Windows này cho phép bạn sửa đổi các biến môi trường được sử dụng bởi hệ điều hành và các ứng dụng đang chạy trên máy tính của bạn. Biến môi trường PATH mà chúng ta sẽ xác định tiếp theo chỉ định danh sách các thư mục mà hệ điều hành sẽ tìm kiếm khi tìm kiếm các tệp thực thi.
- Để mở cái này, hãy vào thanh tìm kiếm trên Windows và gõ “đường dẫn”.

- Trong Thuộc tính hệ thống> Nâng cao, hãy chuyển đến “Biến môi trường”

- Trong Biến môi trường, bên dưới “Biến người dùng cho quản trị viên”, chọn Đường dẫn (1) > sau đó nhấp vào “Chỉnh sửa”.

- Cửa sổ “Chỉnh sửa biến môi trường” mới sẽ mở ra. Bấm vào Mới (1) > Nhập Đường dẫn nơi FFmpeg được lưu trữ (2) > Bấm vào Đồng ý (3).

- Bây giờ, bất cứ khi nào bạn muốn chạy FFmpeg từ bất kỳ thư mục hoặc vị trí nào, máy tính sẽ biết nó ở đâu và cho phép bạn sử dụng nó.
- Bây giờ, hãy kiểm tra cấu hình FFmpeg từ dấu nhắc lệnh của Windows. Mở “cmd” và gõ 'ffmpeg'. Bạn sẽ nhận được một kết quả như bên dưới.

- FFprobe đi kèm với bản cài đặt FFmpeg (như bạn có thể nhận thấy ở trên). Để kiểm tra FFprove, bạn làm tương tự như ffmpeg. Chỉ cần vào dấu nhắc lệnh và gõ 'ffprobe'.
Tăng tốc yt-dlp với RapidSeedbox 🚀
Chán nản vì tải chậm, bị cấm IP, hoặc giới hạn dung lượng? Với RapidSeedbox, bạn sẽ mở khóa:
🔥 Tốc độ 10Gbps siêu nhanh Tải toàn bộ playlist chỉ trong vài giây
🛡️ Riêng tư tuyệt đối – Giữ IP của bạn ẩn và tránh bị bóp băng thông
📺 Phát trực tuyến ngay lập tức – Dùng Plex hoặc Jellyfin để xem nội dung mọi lúc mọi nơi
💾 Dung lượng khổng lồ – Lưu trữ toàn bộ thư viện media mà không lo đầy ổ
⏱️ Tự động 24/7 – Lên lịch chạy các script yt-dlp khi bạn đang ngủ
4. Cách sử dụng YT-DLP trong Windows và Linux.
Như bạn có thể đã biết, YT-DLP là một công cụ dòng lệnh để tải xuống video, vì vậy để sử dụng nó (trong Windows hoặc Linux), bạn sẽ phải truy cập vào dấu nhắc lệnh hoặc thiết bị đầu cuối. Nếu bạn đã tải xuống, cài đặt nó cùng với các phần phụ thuộc của nó, hãy tiếp tục và mở thiết bị đầu cuối của bạn.
Tuyên bố miễn trừ trách nhiệm: Tải xuống video từ YouTube bằng các công cụ như yt-dlp có khả năng vi phạm điều khoản dịch vụ, bản quyền và quyền sở hữu trí tuệ của người tạo nội dung. Điều quan trọng là phải công nhận và tuân thủ các luật và quy định hiện hành liên quan đến việc tải xuống và phân phối tài liệu có bản quyền trong phạm vi quyền hạn của bạn. Lưu ý này không cấu thành tư vấn pháp lý và không nên dựa vào như vậy.
a. Làm cách nào để sử dụng YT-DLP trong Windows?
- YT-DLP chạy trên dòng lệnh (nó không có GUI giao diện người dùng). Khi bạn chạy nó từ cmd.exe lần đầu tiên (không có bất kỳ đối số nào), bạn sẽ thấy một thông báo lỗi (chẳng hạn như sau): “YT-DLP.exe: lỗi: Bạn phải cung cấp ít nhất một URL.

- Hãy tiếp tục và truy cập menu trợ giúp. Để xem danh sách tất cả các tùy chọn, hãy nhập lệnh “YT-DLP –help”. Một menu như sau sẽ xuất hiện trong thiết bị đầu cuối của bạn (hoặc dấu nhắc lệnh):

- Để sử dụng YT-DLP, hãy đảm bảo rằng bạn đang ở cùng một vị trí với YT-DLP.exe và sử dụng nó với “YT-DLP (theo URL youtube), chẳng hạn:
|
1 |
yt-dlp https://www.youtube.com/watch?v=1PmJeP-TphM |

- YT-DLP cho phép bạn sử dụng các đối số để cung cấp cho bạn nhiều tùy chọn hơn khi tải xuống video youtube của bạn.
- Ví dụ: bạn có thể cho YT-DLP biết chính xác định dạng bạn muốn và cách tải xuống. Để thực hiện việc này, trước tiên bạn có thể phải tìm hiểu xem có những định dạng nào: Sử dụng lệnh sau:
|
1 |
yt-dlp -F --list-formats https://www.youtube.com/watch?v=1PmJeP-TphM |

- Bây giờ, bạn có thể muốn tải xuống video youtube (ví dụ: https://www.youtube.com/watch?v=1PmJeP-TphM) với định dạng (-f) video chất lượng tốt nhất và âm thanh tốt nhất hiện có (với định dạng cụ thể); để làm điều này sử dụng lệnh sau:
|
1 2 |
yt-dlp -f “bestvideo[ext=mp4]+bestaudio[ext=m4a]” https://www.youtube.com/watch?v=1PmJeP-TphM |

- Để tìm hiểu thêm về các đối số này và cách sử dụng chúng đúng cách, hãy sử dụng lệnh YT-DLP –help”.
- Và đó là cách chúng tôi đã tải xuống hai video youtube bằng YT-DLP.

b. Lệnh yt-dlp cho Linux
- Giống như Windows, trong Ubuntu Linux, nếu bạn nhập YT-DLP [không có đối số] trong bảng điều khiển đầu cuối, bạn sẽ nhận được thông báo lỗi.

- Nếu cần xem menu trợ giúp YT-DLP, hãy sử dụng lệnh sau YT-DLP –help
- Nếu bạn muốn tải xuống video youtube với chất lượng video tốt nhất và âm thanh tốt nhất hiện có, hãy sử dụng lệnh sau:
|
1 |
yt-dlp -f 'bv*+ba' https://www.youtube.com/watch?v=1PmJeP-TphM |

Lưu ý: Nếu bạn thấy thông báo CẢNH BÁO sau: “Bạn đã yêu cầu hợp nhất nhiều định dạng (của video và âm thanh), nhưng FFmpeg chưa được cài đặt. Các định dạng sẽ không được hợp nhất.” có nghĩa là bạn chưa cài đặt FFmpeg… Để biết cách cài đặt FFmpeg, hãy quay lại phần (cài đặt FFmpeg).
- Bây giờ, nếu bạn muốn tải xuống một định dạng cụ thể cho video youtube của mình thì sao? Một lệnh Định dạng hữu ích là “-F –list-formats.” Ví dụ: chúng tôi muốn liệt kê các định dạng có sẵn trên video >
|
1 |
yt-dlp -F --list-formats https://www.youtube.com/watch?v=1PmJeP-TphM |

- Ví dụ: từ đầu ra ở trên, bạn có thể thấy rằng video youtube này có sẵn để tải xuống với video và âm thanh ở độ phân giải 144p, 360p và 720p. Bây giờ, hãy chỉ định định dạng mà chúng tôi muốn tải xuống.
- Chúng tôi sẽ sử dụng một video khác làm ví dụ. Đầu tiên (như được hiển thị trước đây) xem các định dạng có sẵn và sau đó sử dụng lệnh “-f 'bv*[height=…]+ba'” để chỉ định định dạng. Ví dụ,
|
1 |
yt-dlp -F --list-formats https://www.youtube.com/watch?v=9jw9W7kUBFk |
|
1 |
yt-dlp -f 'bv*[height=720]+ba' https://www.youtube.com/watch?v=9jw9W7kUBFk |

- Sử dụng bộ lệnh trên sẽ giúp bạn xác định cụ thể hơn về định dạng video youtube mà bạn muốn tải xuống. Thay vì tải xuống mức cao nhất (ví dụ 4K), bạn có thể chỉ định định dạng âm thanh và video.
- Ngoài ra, bạn sẽ nhận thấy rằng thông báo CẢNH BÁO FFmpeg không hiển thị. Điều này là do tại thời điểm này, chúng tôi đã cài đặt FFmpeg đúng cách.
❓Cách tải phụ đề bằng yt-dlp?
yt-dlp cho phép bạn tải phụ đề từ các trang được hỗ trợ như YouTube. Phần hay nhất? Bạn thậm chí có thể chọn ngôn ngữ phụ đề.
Ví dụ lệnh:
|
1 |
yt-dlp --write-subs --sub-langs en https://www.youtube.com/watch?v=VIDEO_ID |
- --write-subs: tải phụ đề
- --sub-langs en: chọn tiếng Anh (thay en bằng mã ngôn ngữ bạn muốn)
To embed subtitles into the video, add –embed-subs. For all available languages, use –sub-langs all.
5. Sử dụng nâng cao cho Plugin YT-DLP.
Dưới đây chúng tôi sẽ chỉ cho bạn hai cách sử dụng nâng cao hơn cho plugin YT-DLP. Chúng tôi sẽ cho bạn thấy những ví dụ này trên Linux.
a. Định cấu hình tệp YT-DLP.conf.
Plugin YT-DLP cũng cung cấp tùy chọn thiết lập một loạt giá trị mặc định mà nó sẽ tự động triển khai, bao gồm định dạng video ưa thích như mkv, mp4, webm, v.v. Để tạo tệp cấu hình mà YT-DLP có thể sử dụng, hay nhập hỗ trợ lệnh vào tập tin cấu hình. Có thể tải tệp cấu hình từ hệ thống (/etc/YT-DLP.conf), cấu hình người dùng, cấu hình gia đình, cấu hình di động hoặc cấu hình chính.
- Mở (hoặc tạo) YT-DLP.conf từ thiết bị đầu cuối của bạn bằng trình soạn thảo văn bản:
|
1 |
sudo vim /etc/yt-dlp.conf |
- Hoặc
|
1 |
sudo vi /etc/yt-dlp.conf |
- Tệp cấu hình dưới đây là một ví dụ (nhưng bạn có thể tùy chỉnh nó theo sở thích của riêng mình). Sử dụng cấu hình bên dưới, YT-DLP sẽ tự động lưu tất cả các video trong một đường dẫn cụ thể (/Youtube) và đổi tên chúng thành Title.extension. Theo mặc định, YT-DLP lưu video youtube vào đường dẫn mặc định và cung cấp URL làm tiêu đề chính.
Cấu hình cũng sẽ nhúng hình thu nhỏ, siêu dữ liệu và phụ đề tiếng Anh.

- Bây giờ, hãy thử cấu hình YT-DLP hoàn toàn mới của chúng tôi:
|
1 |
yt-dlp https://www.youtube.com/watch?v=z8HY1aVzZDM |

Với tệp cấu hình này, bạn có thể tự động hóa toàn bộ quá trình tải xuống youtube của mình. Điều này giúp bạn tiết kiệm thời gian vì bạn không còn phải nhập cấu hình cho từng dòng tải xuống video. Tệp cấu hình sẽ sử dụng định dạng tải xuống được cá nhân hóa của bạn cho quy trình.
Lưu ý (Đối với người dùng Windows): Bạn nên đặt tệp cấu hình này trong “${APPDATA}/YT-DLP/config” và lưu dưới dạng .txt. Thư mục AppData nằm trong “C:\Users\\AppData\” và thường là một thư mục ẩn. Việc đặt các dòng cấu hình trong tệp cấu hình này tương tự như những gì chúng ta đã làm với Linux trong phần này.
Mệt mỏi vì phải sao chép và dán lệnh hoài? 🤔 Tải miễn phí PDF của chúng tôi: YT-DLP Cheat-Sheet – 50 lệnh YT-DLP hữu ích.
b. Sử dụng tệp Bashrc.
Một cách khác để bạn có thể tối ưu hóa quy trình tải xuống của mình bằng YT-DLP là sử dụng các tệp bashrc. Các tệp này chứa cài đặt trình bao (giao diện dòng lệnh) cho trình bao Bash. Tệp bashrc được thực thi mỗi khi phiên cuối mới được mở và tệp này có thể được sử dụng để định cấu hình các cài đặt và bí danh khác nhau cho trình bao. Tệp bashrc có thể rất hữu ích cho YT-DLP, vì bạn có thể sử dụng tệp này để thiết lập bí danh hoặc hàm trình bao giúp đơn giản hóa việc sử dụng YT-DLP. Ví dụ: bạn có thể tạo bí danh tự động tải xuống video ở định dạng và chất lượng ưa thích của mình bằng cách nhập một lệnh trong thiết bị đầu cuối. Điều này có thể giúp bạn tiết kiệm thời gian và giúp bạn sử dụng YT-DLP thường xuyên dễ dàng hơn.
- Để xác định vị trí .bashrc (trong Ubuntu), hãy truy cập home/ubunu > .bashrc

- Mở .bashrc bằng bất kỳ trình soạn thảo văn bản nào sau đây.
|
1 |
sudo vi ~/.bashrc |
Hoặc
|
1 |
sudo nano ~/.bashrc |
- Nhập tên bashrc cho YT-DLP mà bạn muốn. Ví dụ:
|
1 2 3 4 |
# yt-dlp aliases alias ydl='yt-dlp' alias ydlmp4='yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best"' alias ydlmkv='yt-dlp -f "bestvideo[ext=mkv]+bestaudio[ext=mka]/best[ext=mkv]/best"' |

- Để kích hoạt tên, hãy đóng và mở lại cửa sổ đầu cuối hoặc chạy lệnh sau:
|
1 |
$ source ~/.bashrc |
- Bây giờ, hãy kiểm tra tên của chúng ta. Điều này sẽ làm cho cuộc sống của chúng ta dễ dàng hơn khi tải xuống video youtube bằng YT-DLP. Sử dụng tên; ví dụ: bằng cách nhập “ydlmp4”, bạn tiết kiệm được thời gian viết các lệnh dài như bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best
- Có rất nhiều điều xảy ra bây giờ! Như bạn có thể thấy từ đầu ra bên dưới… Tên của chúng ta đang hoạt động, cấu hình đang cố gắng nhúng hình thu nhỏ, phụ đề, siêu dữ liệu, v.v. Ngoài ra, video đang được lưu trong (và với) /Youtube/%(title)s.%.% (ext)s – trong đó tiêu đề là tên của video chứ không phải URL.

c. Quản lý và tải xuống một lượng lớn dữ liệu video bằng YT-DLP vào một seedbox.
Nếu bạn tải xuống và quản lý một lượng lớn dữ liệu bằng YT-DLP, thì seedbox có thể là một giải pháp tuyệt vời. Seedbox là một VPS từ xa hoặc máy chủ chuyên dụng được thiết kế để tải xuống và tải lên ẩn danh các tệp kỹ thuật số, chẳng hạn như torrent, NZB, video và nhạc. Ngoài ra, vì seedbox được thiết kế để tải xuống và tải lên nên chúng thường cung cấp tốc độ cao.
Chẳng hạn, bạn có thể kết nối từ xa với seedbox của mình và sử dụng các tài nguyên mạnh mẽ của nó để tải xuống video bằng YT-DLP. Seedbox cũng cung cấp các nền tảng phát trực tuyến như Plex hoặc Kodi và những cách tuyệt vời khác để quản lý bộ sưu tập phương tiện của bạn. Ngoài ra, nếu sau này bạn quyết định thay đổi định dạng, nén hoặc mã hóa, seedbox cũng đi kèm với các bộ chuyển đổi phương tiện mạnh mẽ như Handbrake. Sau đó, bạn có thể tải xuống tất cả nội dung phương tiện của mình một cách dễ dàng bằng các giao thức FTP hoặc Đồng bộ hóa.
Sự kết hợp này cho phép tải xuống nhanh chóng và hiệu quả cũng như quản lý dễ dàng tất cả nội dung đã tải xuống của bạn.
6. YT-DLP: Ưu và nhược điểm
Although yt-dlp has many great features and characteristics that make it one of the best YouTube downloaders, it also has a few disadvantages that you should know about. Dưới đây là một số ưu và nhược điểm của việc sử dụng YT-DLP.
a. Ưu điểm:
- Miễn phí và mã nguồn mở: YT-DLP miễn phí 100%. Nó cũng là một dự án mã nguồn mở được duy trì bởi một cộng đồng vững chắc gồm các nhà phát triển.
- Hỗ trợ đa nền tảng để xem cài đặt: YT-DLP có sẵn cho Windows, Linux và macOS. Hỗ trợ đa nền tảng này giúp nhiều người dùng có thể truy cập được.
- Nhiều tùy chọn tải xuống video: Mặc dù YT-DLP là một trong những tùy chọn tốt nhất cho chức năng của nó, “tải xuống video youtube”, nhưng nó cũng có các tùy chọn bổ sung khó thấy ở các trình tải xuống video khác. Các tùy chọn tải xuống này bao gồm định dạng video, lựa chọn phụ đề và hình ảnh thu nhỏ.
- Thử lại tự động:: yt-dlp has some fantastic automation capabilities. One of the best features is that it can automatically retry failed downloads, saving you time and effort.
- Hỗ trợ nhiều trang web và tiện ích mở rộng hơn: yt-dlp supports more sites other than YouTube, including Vimeo and Youku. It also supports browser extensions like SponsorBlock, to allow you to skip sponsored segments in YouTube videos.
b. Nhược điểm:
- Không có GUI: Một nhược điểm đối với nhiều người khi sử dụng YT-DLP là thiếu GUI. YT-DLP là công cụ dòng lệnh, có thể không lý tưởng cho người dùng thích giao diện người dùng đồ họa.
- Yêu cầu cấu hình:Như bạn có thể nhận thấy từ hướng dẫn từng bước của chúng tôi để định cấu hình và sử dụng YT-DLP, công cụ này yêu cầu một số kiến thức về cấu hình của nó. Để sử dụng YT-DLP, bạn phải tìm hiểu các dòng cấu hình để có được định dạng đầu ra video, chất lượng âm thanh mong muốn hoặc các tùy chọn khác.
- Không có gói chính thức: YT-DLP không có gói chính thức cho một số nền tảng. Nếu bạn có kỹ năng và sự kiên nhẫn để xây dựng nó từ một nguồn hoặc dựa vào kho lưu trữ của bên thứ ba, thì việc không có gói chính thức có thể không gây bất lợi cho bạn.
- Mối quan tâm pháp lý: Việc tải video từ YouTube về về mặt kỹ thuật là vi phạm Điều khoản Dịch vụ của họ. Về lý thuyết, công ty hoàn toàn có thể kiện bạn. Tuy nhiên, nhiều người dùng vẫn quyết định làm điều đó, và YouTube cho đến nay chưa có dấu hiệu muốn trừng phạt người dùng vì hành động tải video. Tuy vậy, bạn vẫn nên nhận thức rõ về các hậu quả pháp lý khi tải nội dung có bản quyền mà không được phép.
7. yt-dlp vs youtube-dl: Key Differences
While both tools serve the same core purpose—downloading media from platforms like YouTube—yt-dlp is a more modern, actively maintained fork of the older youtube-dl, with numerous enhancements.
Dưới đây là bảng so sánh trực tiếp giữa các tính năng quan trọng nhất của hai công cụ này:
| Tính năng | yt-dlp ✅ (Khuyến nghị) | youtube-dl ❌ (Đã lỗi thời) |
|---|---|---|
| Trạng thái phát triển | Được bảo trì và cập nhật thường xuyên | Mostly abandoned (last update: 2026) |
| Chọn định dạng | Nâng cao, ưu tiên codec và độ phân giải | Cơ bản, ưu tiên bitrate |
| Tích hợp SponsorBlock | ✅ Hỗ trợ đánh dấu/xoá đoạn | ❌ Không hỗ trợ |
| Tải đoạn theo luồng đa luồng | ✅ Tăng tốc độ tải video dạng streaming | ❌ Chỉ tải đơn luồng |
| Tuỳ chỉnh đường dẫn và mẫu tên file | ✅ Linh hoạt với --paths và mẫu nâng cao | Hạn chế |
| Đăng nhập OAuth & trích cookie từ trình duyệt | ✅ Hỗ trợ đầy đủ | Hạn chế hoặc phải thiết lập thủ công |
| Chia video theo chương | ✅ Với tùy chọn --split-chapters | ❌ Không hỗ trợ |
| Tải từ tệp .txt (-a) | ✅ Có hỗ trợ | ✅ Có hỗ trợ |
| Hỗ trợ livestream | ✅ Với --live-from-start | Hỗ trợ kém hoặc đã lỗi thời |
| Giới hạn tốc độ tải | ✅ Với --rate-limit | ✅ Cũng có hỗ trợ |
| Mẫu tên file mặc định | %(title)s [%(id)s].%(ext)s | %(title)s-%(id)s.%(ext)s |
| Yêu cầu phiên bản Python | Python 3.9+ | Python 2.6+ và 3.2+ |
| Tự cập nhật | ✅ yt-dlp -U hoặc --update-to | ❌ Chỉ cập nhật thủ công |
| Hỗ trợ plugin | ✅ Hỗ trợ trình trích xuất/hậu xử lý ngoài | ❌ Không hỗ trợ |
| Tương thích với GUI | Hoạt động tốt với GUI hiện đại (vd: yt-dlp-gui, Jely GUI) | Tùy chọn hạn chế, phần lớn lỗi thời |
| Ước tính kích thước tải từ manifest | ✅ (có thể bật với cờ tương thích) | ❌ Không hỗ trợ |
| Nhúng phụ đề và cải tiến | ✅ Xử lý nâng cao với mặc định thông minh | Hỗ trợ phụ đề cơ bản |
8. YT-DLP: FAQ.
Đáp: YT-DLP cung cấp các tính năng và tùy chọn bổ sung không có trong youtube-dl. Nó cũng có một cộng đồng phát triển tích cực để đảm bảo rằng các lỗi nhanh chóng được sửa và các tính năng mới được thêm vào. Hãy đọc phần trước của chúng tôi: Ưu điểm & Nhược điểm..
Đáp: Bạn có thể cài đặt YT-DLP trên Linux, Windows hoặc macOS bằng cách tải xuống tệp thực thi nhị phân hoặc bằng cách cài đặt tệp qua trình quản lý gói của hệ điều hành của bạn. Để tìm hiểu cách cài đặt YT-DLP, hãy quay lại phần “cách tải xuống và cài đặt YT-DLP”.
Đáp: Có, bạn có thể tải xuống video ở các định dạng khác nhau bằng YT-DLP. Bạn có thể chỉ định định dạng bằng các tùy chọn dòng lệnh hoặc chỉnh sửa tệp cấu hình.
Đáp: Một số nội dung trên YouTube có thể được bảo vệ bản quyền, và việc tải xuống mà không có sự cho phép có thể là hành vi vi phạm pháp luật. Việc tải video từ YouTube cũng trái với Điều khoản Dịch vụ (ToS) của nền tảng này. Tuy nhiên, nhiều người vẫn thực hiện điều đó, và YouTube cho đến nay chưa có động thái xử lý người dùng vì hành vi này.
Đáp: Có, YT-DLP cho phép bạn tải xuống toàn bộ danh sách phát video bằng cách chỉ định URL của danh sách phát.
Đáp: Có, YT-DLP hỗ trợ phụ đề cho video ở nhiều định dạng khác nhau. Bạn có thể nhúng phụ đề vào các bản tải xuống của mình và chỉ định ngôn ngữ phụ đề ưa thích.
Đáp: Có, YT-DLP cho phép bạn tải xuống các tệp chỉ có âm thanh ở nhiều định dạng khác nhau ngoài video, chẳng hạn như MP3 và AAC.
Đáp: Có, YT-DLP được duy trì tích cực bởi một nhóm các nhà phát triển chuyên nghiệp để phục vụ khách hàng tải xuống video thường xuyên phát hành các bản cập nhật và sửa lỗi.
Đáp: Có! Bạn có thể sử dụng GUI để tránh dùng dòng lệnh. Các công cụ này cho phép bạn dán liên kết, chọn định dạng và quản lý quá trình tải dễ dàng:
– Jely yt-dlp GUI – Giao diện hiện đại, trực quan
– Oleksis yt-dlp GUI – Đơn giản và hiệu quả
– yt-dlp Web UI – Giao diện chạy trên trình duyệt
A: Có! yt-dlp chạy được trên thiết bị di động. Điều này rất tiện cho việc tải nhanh video trực tiếp từ điện thoại hoặc máy tính bảng. Được hỗ trợ: Android: Dùng Termux với: pkg install python ffmpeg && pip install -U yt-dlp – iOS: Dùng a-Shell hoặc iSH, sau đó: pip install -U yt-dlp
9. Lời kết.
Tóm lại, yt-dlp là một công cụ tải video mạnh mẽ và giàu tính năng. Với danh sách tùy chọn phong phú cùng khả năng hỗ trợ nhiều định dạng và trang web video khác nhau, không có gì ngạc nhiên khi yt-dlp trở thành nền tảng tải video YouTube hàng đầu hiện nay.
Nếu bạn chưa sở hữu nó, chúng tôi khuyên bạn nên dùng thử YT-DLP. Bạn sẽ nhanh chóng thấy tại sao YT-DLP đang trở thành lựa chọn hàng đầu để tải xuống video.
Chúng tôi khuyên bạn nên liên hệ với người bảo trì dự án YT-DLP trên GitHub nếu bạn gặp phải bất kỳ sự cố nào trong việc tải xuống video hoặc có đề xuất cho các tính năng mới. Nhưng nếu bạn có bất kỳ câu hỏi hoặc đề xuất nào về hướng dẫn YT-DLP này, vui lòng cho chúng tôi biết trong hộp nhận xét bên dưới.
Tăng tốc yt-dlp với RapidSeedbox 🚀
Chán nản vì tải chậm, bị cấm IP, hoặc giới hạn dung lượng? Với RapidSeedbox, bạn sẽ mở khóa:
🔥 Tốc độ 10Gbps siêu nhanh Tải toàn bộ playlist chỉ trong vài giây
🛡️ Riêng tư tuyệt đối – Giữ IP của bạn ẩn và tránh bị bóp băng thông
📺 Phát trực tuyến ngay lập tức – Dùng Plex hoặc Jellyfin để xem nội dung mọi lúc mọi nơi
💾 Dung lượng khổng lồ – Lưu trữ toàn bộ thư viện media mà không lo đầy ổ
⏱️ Tự động 24/7 – Lên lịch chạy các script yt-dlp khi bạn đang ngủ
Recommend using Aria2 with yt-dlp, speeds up downloads by A LOT!
would love to give that a try!
How do I implement Phython?
Hi Fyr,
First, you need to install it on your device. If you share more details, I may be able to help you further.
Hey there Fyr! 👋 If you’re asking how to implement Python to use yt-dlp, you’ll just need to install Python (if it’s not already installed), then run: pip install -U yt-dlp
After that, you can run commands like this: yt-dlp https://www.youtube.com/watch?v=VIDEO_ID
Let me know if you’re starting from scratch or need help setting it up on Windows, macOS, or Linux — happy to walk you through it!
Diego
Thank you for the article, very useful.
There is a small error…
“Open the .bashrc with any of the following text editors.
sudo vi ~/.bahsrc
Hoặc
sudo nano ~/.bahsrc”
It will create a separate file that is not .bashrc
Thanks for your observation, Maxime.
If you open the .bashrc file using the sudo vi ~/.bashrc or sudo nano ~/.bashrc command, it will open the existing .bashrc file located in your home directory with root user privileges, allowing you to make changes to the file.
But, if you accidentally save the file using a different name or in a different location, it will indeed create a new file.
@Maxime is pointing-out that you have a typo in your code examples. You need to edit the post to correct those examples.
Ooooh… I get you… that typo! I missed it! Thanks, JCH and Maxime!
bro do we need to learn coding to use it ???
Hi Mahesh, you don’t have to learn code to use YT-DLP, but because it’s a command-line application you must be familiar with the operators to get it working. These are additional commands added on the the end of the execution that provides YT-DLP with the instructions on what you want it to do.
The example code snippet for downloading the best audio & video has an error.
You have: ./yt-dlp -f “bestvideo[ext=mp4]+bestaudio[ext=m4a]”
The correct way is: ./yt-dlp -f “bestvideo[ext=mp4]+bestaudio[ext=m4a]”
Thanks… But what changes?
There is a space between -f and “best vid…” You missed the space.
How do I download a video at 720p?
136+140 for your resolution. mp4 720p
in my script
$yt –add-metadata \
–write-auto-subs \
-f “$res” \
-o ‘%(title)s.%(ext)s’ “$video_url”
Hey there James,
try the following:
yt-dlp –format ‘best[height=720]’ <video_url>
Hello, I am trying to download an (.mp4) audio file from MixCloud and am wondering how would you specify a “best audio” command for that?
Hi there Noah!
Have you tried the following?
yt-dlp –format bestaudio < MixCloud_audio_url >
Hi, I want to catch some video quality KPIs. Can I call and How can I get with yt-dlp?
Hi there Tan.. Yt-dlp focuses on video downloads… is the best for that… but still, you can also get detailed information about the available video formats, including resolution, bitrate, codec, and file size.
For example, if you run yt-dlp [video_url] in the command line, you would get a list of available formats along with their attributes (KPIs)..
Can you add a date stamp to the file name?
(a ten (10) character date stamp YYYYMMDDa_)
Example:
20230922a_
20230922a_Video_title-[b8azpQ6AK2p7].mp4
Using:
yt-dlp –version
2023.07.06
Kubuntu 22.04
Command:
yt-dlp –restrict-filenames –write-description –write-comments –write-thumbnail –write-link -P /home/x/Downloads/ https://www…./
Hey there Joseph,
You can add a date stamp to the file name in yt-dlp by using the -o option with a template that includes the date stamp in the format you are looking for (YYYYMMDDa). Here’s an example of your command with the -o option, (first check your yt-dlp version):
yt-dlp –version
yt-dlp –restrict-filenames -o “%(upload_date>%Y%m%d)a_%(title)s-%(id)s.%(ext)s” –write-description –write-comments –write-thumbnail –write-link -P /home/x/Downloads/ https://www…/
Please, if you manage, let us know your results.
Hello Diego,
1.
yt-dlp –version
2022.04.08
2.
sudo yt-dlp –update
Usage: yt-dlp [OPTIONS] URL [URL…]
yt-dlp: error: yt-dlp’s self-update mechanism is disabled on Debian.
Please update yt-dlp using apt(8).
See https://packages.debian.org/sid/yt-dlp for the latest packaged version.
3.
How to update yt-dlp?
from 2022.04.08
__to 2023.09.24-1
4.
Is above update problem a funciton of Operating System?
Kubuntu 22.04.3
hoặc
yt-dlp
5.
ERROR: ‘upload_date>%%Y-%%m-%%d’
yt-dlp –restrict-filenames -o “%(upload_date>%Y-%m-%d)a_%(title)s-%(id)s.%(ext)s” –write-description –write-comments –write-thumbnail –write-link -P /home/x_/Downloads/ https://www…
Joseph, thanks for giving me more context. Try the following
It seems you need to update your yt-dlp instance: sudo apt update && sudo apt upgrade yt-dlp
The template for the date stamp, it should be %(upload_date)s. Try the following command:
yt-dlp –restrict-filenames -o “%(upload_date>s{YYYYMMDD})a_%(title)s-%(id)s.%(ext)s” –write-description –write-comments –write-thumbnail –write-link -P /home/x/Downloads/ https://www…/
I hope that helps!
Good day Diego,
Strange, the sudo … command did not update yt-dlp.
Details below:
yt-dlp –version
2022.04.08
sudo apt update && sudo apt upgrade yt-dlp
Hit:1 http://ca.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://ca.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:4 http://ca.archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:5 http://ca.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [503 kB]
Get:6 http://ca.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1,058 kB]
Get:7 http://ca.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [989 kB]
Get:8 http://ca.archive.ubuntu.com/ubuntu jammy-updates/universe i386 Packages [658 kB]
Fetched 3,437 kB in 1s (3,568 kB/s)
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
1 package can be upgraded. Run ‘apt list –upgradable’ to see it.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
yt-dlp is already the newest version (2022.04.08-1).
Calculating upgrade… Done
Get more security updates through Ubuntu Pro with ‘esm-apps’ enabled:
vlc-plugin-qt libvlc5 vlc-data libvlccore9 vlc imagemagick vlc-bin vlc-l10n
libavdevice58 ffmpeg libopenexr25 libpostproc55 libmagickcore-6.q16-6-extra
vlc-plugin-samba libavcodec58 libmagickwand-6.q16-6 vlc-plugin-notify
libavutil56 imagemagick-6.q16 libswscale5 libeditorconfig0
libmagickcore-6.q16-6 vlc-plugin-access-extra vlc-plugin-skins2
vlc-plugin-video-splitter libswresample3 imagemagick-6-common
vlc-plugin-video-output libavformat58 libvlc-bin vlc-plugin-base
vlc-plugin-visualization libavfilter7
Learn more about Ubuntu Pro at https://ubuntu.com/pro
The following packages will be upgraded:
alsa-ucm-conf
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 43.3 kB of archives.
After this operation, 25.6 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ca.archive.ubuntu.com/ubuntu jammy-updates/main amd64 alsa-ucm-conf all 1.2.6.3-1ubuntu1.8 [43.3 kB]
Fetched 43.3 kB in 0s (302 kB/s)
(Reading database … 228013 files and directories currently installed.)
Preparing to unpack …/alsa-ucm-conf_1.2.6.3-1ubuntu1.8_all.deb …
Unpacking alsa-ucm-conf (1.2.6.3-1ubuntu1.8) over (1.2.6.3-1ubuntu1.7) …
Setting up alsa-ucm-conf (1.2.6.3-1ubuntu1.8) …
yt-dlp –version
2022.04.08
restart computer
yt-dlp –version
2022.04.08
Stil old version of yt-dlp, No updating
from 2022.04.08
__to 2023.09.24-1
Question:
Would a BIOS setting effect the sudo command?
sudo apt update && sudo apt upgrade yt-dlp
To update:
sudo yt-dlp -U
Interesante articulo, di con el en busca de como podia hacer con yt-dlp para descargar un video desde una pagina web accediendo con su id. El video esta en un div de la pagina web. Se entiende la pregunta ?
Saludos.
Hola Norberto.
Me alegra que encuentres interesante nuestro articulo de YT-DLP.
No se si entiendo bien tu pregunta… Pero puedes acceder al video si tienes el id… intenta usar el siguiente commando:
yt-dlp [URL o ID_del_video]
Espero que te funcione.
Hi, nice article.
You could have included how the aspect ratio, and frame rate of video will be getting downloaded when you use this software. mp4and m4a examples are formats of video and audio. will the video downloaded will be as in the same frame rate and aspect ratio. plase tell
Hi there Jraju.
Thanks for feedback. We will surely include these informaiton on our coming update for this article.
Good day Diego,
yt-dlp –version
2023.10.13
Kubuntu 22.04
What is the yt-dlp command? The command to get:
20231131a_Title_of_Video-z2Ba75OrtIKN.mp4 but actual result is:
s_YYYYMMDD_Title_of_Video-z2Ba75OrtIKN.mp4
yt-dlp –restrict-filenames -o “%(upload_date>s{YYYYMMDD})a_%(title)s-%(id)s.%(ext)s” –write-description –write-comments –write-thumbnail –write-link -P /home/xx/Downloads/ https://www…
side note:
the web page converts
— = 2 dashes to 1 dash –
” = square quotes to curly quotes “ ”
end —
ERROR: unable to open for writing: [Errno 13] Permission denied:
🙁 We dont like errors! Jorge, what happend? …. give more context/details?
Hola, una pregunta, podria cambiar la ruta de descarga? los videos descargan directamente a esta ruta:
C:\Users\Mi Usuario
como puedo cambiar la ruta y darle otra ubicacion para los videos o la lista de videos descargados??
Hola Bryan,
Para cambiar la ruta de descarga en yt-dlp, debes especificar un nuevo directorio en el comando de descarga. Por ejemplo, si deseas descargar en la carpeta “D:\Mis Videos”, tu comando sería algo como yt-dlp -o “D:\Mis Videos\%(title)s.%(ext)s” [URL del video]. Esto indicará a yt-dlp que guarde los videos en la carpeta especificada. Es importante asegurarte de que la ruta exista y de tener los permisos necesarios para guardar archivos en ella.
Mucha suerte… espero que te sirva!
I only get an error when I try to test the Path of FFmpeg or FFProbe
“‘ffprobe’ is not recognized as an internal or external command,
operable program or batch file.”
I use path “C:\PATH_Programs -ytdpl” and CMD is set up for C:\Users\Me>
If I use cd and go to C:\PATH_Programs -ytdpl and test I get results like the screenshot when you did it.
Hi James…
So, if the system’s PATH environment variable does not include the directory where ffprobe and ffmpeg are located… try the following:
> Ensure ffmpeg.exe and ffprobe.exe are in C:\PATH_Programs -ytdpl.
> Update the PATH Environment Variable:
Open System Properties > Advanced > Environment Variables.
Under System variables, find and select Path, then click Edit.
Click New and add C:\PATH_Programs -ytdpl to the list.
Close and reopen CMD, then test by running ffmpeg -version and ffprobe -version from any directory.
Just make sure you’ve correctly spelled the path when adding it to the PATH variable and restart CMD to apply the changes.
I hope that helps!
Hi, I’ve done everything that you’ve said but, it stills says
“‘ffmpeg’ is not recognized as an internal or external command,
operable program or batch file.” or
“‘ffprobe’ is not recognized as an internal or external command,
operable program or batch file.”
Hi Ben, if this is the case we can try forcing yt-dlp to recognize the path using -ffmpeg-location.
yt-dlp -f bestvideo+bestaudio --merge-output-format mp4 --ffmpeg-location "C:\ffmpeg\bin" (Replace “C:\ffmpeg\bin” with the correct path to your FFmpeg installation.)
What are the terminal commands to
install latest version of yt-dlp?
Using:
Kubuntu 22.04.3
yt-dlp –version
2022.04.08
i understand 2022.04.08 is an old version of yt-dlp.
Joseph, we always recommend updating Yt-dlp to the latest version… but if you’re looking to specifically install the version 2022.04.08 of yt-dlp on Kubuntu 22.04.3, you’ll need to manually download that version from the yt-dlp GitHub repository’s release archives. >>> https://github.com/yt-dlp/yt-dlp/releases
Find the direct link to that specific release, by browsing thorugh that “Releases” section, and look for the 2022.04.08 version.
Once found, download the appropriate binary for Linux, and make it executable. You’ll need to manually install it, rather than automatically update it
To make it executable:
sudo chmod a+rx /usr/local/bin/yt-dlp
Then verify by running yt-dlp –version.
What is the yt-dlp command?
How to add a date stamp to the file name?
(a ten (10) character date stamp YYYYMMDDa_ )
Example:
20240126a_
20240126a_Video_title-[b8azpQ6AK2p7].mp4
Using:
yt-dlp –version
2023.12.30
Kubuntu 22.04
Command with no date stamp:
yt-dlp –restrict-filenames –write-link -P /home/xx/Downloads/ https://www…./
How to add a date stamp to the file name?
—
Hi there Joseph;
To add a date stamp to the filename in yt-dlp, you can try the output template option. Just, modify your command to include –output “%(upload_date)s_Video_title-[%(id)s].%(ext)s”, replacing %(upload_date)s with the appropriate date format.
In your particular case, it would be for a 10-character date stamp like YYYYMMDDa_, you’d likely need to use %(upload_date)s directly, and then manually adjust it to your specific needs, as yt-dlp might not support custom date formats directly.
I hope that helps!
Bonjour, j’essaie d’installer yt-dlp pour l’utiliser, sous Windows 11. J’ai bien suivi toutes les étapes mais dès que je rentre une commande avec “yt-dlp” j’ai ce message :
yt-dlp : Le terme «yt-dlp» n’est pas reconnu comme nom d’applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez l’orthographe du nom, ou si un chemin d’accès existe, vérifiez que le chemin d’accès est correct et réessayez.
J’ai pourtant “exécuter en tant qu’administrateur” le fichier. J’arrive bien jusqu’à l’utilisation de FFmpeg, c’est vraiment à partir de l’étape 4. Comment utiliser YT-DLP sous Windows et Linux que ça coince. Je pense que j’ai loupé quelque chose mais j’ai repris toutes les étapes 3 fois… Est-ce que vous auriez une piste ?
Bonjour Amandine,
Il semble que le système ne reconnaisse pas “yt-dlp” comme une commande. Cela se produit généralement lorsque l’exécutable du programme n’est pas dans la variable d’environnement PATH de votre système. Pour résoudre cela, vous devez ajouter le répertoire contenant yt-dlp.exe à votre PATH. Voici un guide simplifié :
Localisez yt-dlp.exe sur votre ordinateur.
Copiez le chemin d’accès au dossier où se trouve yt-dlp.exe.
Recherchez “Variables d’environnement” dans les paramètres de Windows 11.
Modifiez la variable PATH pour inclure le chemin d’accès que vous avez copié.
Ouvrez une nouvelle invite de commande et essayez à nouveau la commande yt-dlp.
J’espère que cela vous aide !
À bientôt !
Thanks for info guys!
Can I download all files from urls, when they are in a .txt file.
(I have a txt file, – inside 20 urls from Youtube) in which format urls must be written? by ENTER< or by COMA?
Hi there Oleksly,
Please try the following:
“To download all files from a list of URLs in a .txt file using yt-dlp, the URLs should be written line by line, separated by an Enter (newline), not by a comma. You can use the command yt-dlp -a yourfile.txt to download from all the URLs listed in your text file (yourfile.txt).”
I hope that helps!
that’s very useful and it really works! appreciate about your reply !
Hi Diego, I want to deploy yt-dlp to azure as an endpoint of an api.
Everything is fine, but it seems youtube is blocking my azure VM. Do you know how to configure so I don’t get blocked by YouTube? Do I need a proxy?
Thanks a lot
Hi John; The block likely means that you’re somehow exceeding an unseen threshold. Try adjusting your request rate limit using –sleep-interval and –max-sleep-interval. A proxy might work if you use it to distribute your requests across a bunch of IP addresses. Hope this helps!
Hi Diego
I can’t download your example video:
yt-dlp -f ‘bv*+ba’ https://www.youtube.com/watch?v=1PmJeP-TphM
[youtube] Extracting URL: https://www.youtube.com/watch?v=1PmJeP-TphM
[youtube] 1PmJeP-TphM: Downloading webpage
[youtube] 1PmJeP-TphM: Downloading ios player API JSON
[youtube] 1PmJeP-TphM: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video “aQvGIIdgFDM” instead of “1PmJeP-TphM”)
ERROR: [youtube] 1PmJeP-TphM: Private video. Sign in if you’ve been granted access to this video
I don’t know what the ios and Android lines are about as I’m using Linux but that ‘ERROR’ LINE is telling me I need to sign in so how do I add my YouTube details to the comand please?
Hi Mike, the error code is due to the video now being private. You can try with a different video instead; it should work fine. As for the warnings, that seem part of a yt-dlp bug that was addressed with a nightly build. Try updating yt-dlp with “–update-to nightly”. Hope this helps!
Hi, On Step 2, a, you say to double click on the .exe file in Windows to install. When I double click on it, it tells me that there is an error and that instead of double clicking on the .exe file, I need to call it from the command line.
Hi there.
Thanks for noting that… We had an error in this exact installation step. Sorry for confusing you.
Yes, you need to call it from the command line, not double-click as the article used to say.
We added the following note:
Tệp yt-dlp.exe không phải là trình cài đặt; nó là tệp thực thi của chính yt-dlp. Trong ngữ cảnh của Windows, một tệp thực thi (với phần mở rộng .exe) là một chương trình có thể chạy trực tiếp khi bạn nhấp vào hoặc thực thi từ dòng lệnh. Đối với yt-dlp, bạn chỉ cần đặt tệp yt-dlp.exe vào một thư mục tuỳ chọn (ví dụ: C:\ytdlp) và chạy trực tiếp từ đó.
Buenos días Diego,
Gracias por publicar estas instrucciones. Han sido de mucha utilidad. Sin embargo me encuentro que cuando ejecuto el siguiente comando del tutorial para hacerlo ejecutable en Ubuntu 20.04: $ sudo chmod a+rx /usr/local/bin/yt-dlp, me devuelve un mensaje de error “no existe el archivo o directorio”. Cuando accedo al directorio /usr/local/bin/ me encuentro allí un único archivo llamado yt-dl (sin la ‘p’ final) ¿Me estaría faltando un archivo? Te aclaro que he seguido los pasos del tutorial. Quedo a la espera de lo que puedas comentarme. Gracias de antemano. Un saludo
Hi Bruno, prueba esto:
1. Verifique si yt-dl es la herramienta correcta enumerando el contenido del directorio. Si es así, cámbiele el nombre a yt-dlp:
sudo mv /usr/local/bin/yt-dl /usr/local/bin/yt-dlp
2. Si cambiar el nombre no funciona, vuelve a descargar yt-dlp:
sudo wget -O /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
3. Hazlo ejecutable:
sudo chmod a+rx /usr/local/bin/yt-dlp
4. Verifique la instalación:
yt-dlp –versión
Hola, en windows cuando ejecuto el comando -f y me salen las calidades: hls-398 mp4 512×288 25 │ ~521.66MiB 398k m3u8 │ avc1.4D4015 249k mp4a.40.2 125k /// hls-636 mp4 640×360 25 │ ~833.61MiB 636k m3u8 │ avc1.4D401E 474k mp4a.40.2 125k /// hls-1088 mp4 1024×576 25 │ ~ 1.39GiB 1088k m3u8 │ avc1.4D401F 901k mp4a.40.2 125k /// hls-1945 mp4 1280×720 25 │ ~ 2.49GiB 1945k m3u8 │ avc1.4D401F 1709k mp4a.40.2 125k
/// hls-3571 mp4 1280×720 25 │ ~ 4.57GiB 3571k m3u8 │ avc1.4D401F 3243k mp4a.40.2 125k
¿qué comando tengo que ejecutar para que se descargue la calidad deseada?
Gracias y enhorabuena por el trabajo
Olá Felipe, basta escolher um e utilizá-lo na linha de comando. Por exemplo:
yt-dlp -f hls-1945
Olá Diego,
Que belo passo-a-passo, obrigada!
Acho que fiz tudo certinho, mas vários erros são apresentados, será que vc me daria uma luz?
C:\ytdl>yt-dlp https://www.youtube.com/shorts/IfY5ISwPE1Y
[youtube] Extracting URL: https://www.youtube.com/shorts/IfY5ISwPE1Y
[youtube] IfY5ISwPE1Y: Downloading webpage
WARNING: [youtube] Unable to download webpage: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)
[youtube] IfY5ISwPE1Y: Downloading ios player API JSON
WARNING: [youtube] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131). Retrying (1/3)…
[youtube] IfY5ISwPE1Y: Downloading ios player API JSON
WARNING: [youtube] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131). Retrying (2/3)…
[youtube] IfY5ISwPE1Y: Downloading ios player API JSON
WARNING: [youtube] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131). Retrying (3/3)…
[youtube] IfY5ISwPE1Y: Downloading ios player API JSON
WARNING: [youtube] Unable to download API page: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131) (caused by CertificateVerifyError(‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)’)); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
[youtube] IfY5ISwPE1Y: Downloading iframe API JS
WARNING: [youtube] Unable to download webpage: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)
[youtube] IfY5ISwPE1Y: Downloading web player API JSON
WARNING: [youtube] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131). Retrying (1/3)…
[youtube] IfY5ISwPE1Y: Downloading web player API JSON
WARNING: [youtube] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131). Retrying (2/3)…
[youtube] IfY5ISwPE1Y: Downloading web player API JSON
WARNING: [youtube] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131). Retrying (3/3)…
[youtube] IfY5ISwPE1Y: Downloading web player API JSON
WARNING: [youtube] Unable to download API page: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131) (caused by CertificateVerifyError(‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)’)); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
ERROR: [youtube] IfY5ISwPE1Y: Failed to extract any player response; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
Olá Betina,
Parece que você está executando o yt-dlp com as configurações de certificado padrão. Tente adicionar a opção “–no-check-certificate” ao seu comando. Certifique-se de que seu URL esteja entre aspas duplas ( ” )
Hello,
I’ve already find a solution for the question I submitted earlier.
Using the –no-check-certificates it worked perfectly.
Thank you!
Bethina
Hello, I have an error [youtube] Sign in to confirm you’re not a bot. This helps protect our community. Do you have a solution? For example used oauth2?
Hi Dev, oauth2 is a solution but it’s a bit more complex to implement. Have you tried updating your yt-dlp? If that doesn’t work, have a go with cookies first before trying oauth2. Install a browser extension like “Get cookies.txt” for Chrome or Firefox then export your cookies for YouTube. With that, you can use the –cookies option in yt-dlp.
What command line is needed to download “https://www.youtube.com/watch?v=rkaz2VsAzTE” as mp4 and 720p?
Hi James, you can try yt-dlp -f ‘bestvideo[height<=720]+bestaudio/best[height<=720]' -o '%(title)s.%(ext)s' https://www.youtube.com/watch?v=rkaz2VsAzTE
I received this error “The system cannot find the file specified.”
Hi James, try replacing the single quote with double quotes instead.
(yt-dlp -f bestvideo[height<=720]+bestaudio/best[height<=720] -o “%(title)s.%(ext)s” https://www.youtube.com/watch?v=rkaz2VsAzTE) —– when I added double quotes. I still receive an error of file not found.
I’m afraid this has gone a bit beyond my capabilities. I’ll check with Diego and see if he has a solution.
Hi there James… your command seems ok…. > yt-dlp -f “bestvideo[height<=720]+bestaudio/best[height<=720]" -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=rkaz2VsAzTE —-
But you can also try Automatic Format Selection: yt-dlp -f “bestvideo[height<=720]+bestaudio/best" -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=rkaz2VsAzTE I would suggest checking your dependencies... especially whether FFmpeg is properly installed (up to date?) -- you can also ensure yt-dlp has the correct permissions to write files and that FFmpeg is accessible in your system's PATH.... if yes, you can still try : "Combine video and audio without FFmpeg" >>
yt-dlp -f “bestvideo[height<=720]+bestaudio" --merge-output-format mp4 -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=rkaz2VsAzTE
Cheers,
I hope that helps
При скачивании с любого канала из вкладки shorts программа только прочматривает список и ничего не качает. Пример результата:
PS E:\Video\youtube-dl> ./yt-dlp -f ‘299+140/399+140/137+140/298+140/398+140/136+140/bestvideo[height
Тут всё не зависит ни от канала, ни от кук. просто не качает.
Hi Dmitry, Похоже, ваша команда указывает определенные форматы, которые могут быть недоступны для видео Shorts. Вы можете протестировать без указания форматов, чтобы увидеть, работает ли значение по умолчанию. (./yt-dlp https://www.youtube.com/shorts/).
Если это сработает, то проблема может быть связана с форматами, которые вы указываете. Вы можете проверить, какие форматы доступны, запустив: (./yt-dlp -F https://www.youtube.com/shorts/).
Поскольку короткие видеоролики отличаются от обычных видео, вы также можете попробовать более простую команду, чтобы проверить, правильно ли yt-dlp обрабатывает загрузку: (./yt-dlp https://www.youtube.com/shorts/)
Надеюсь, это поможет!
отдельно видео обозначенные как shorts качаются нормально. Но вот когда они качаются из “https://www.youtube.com/#имя_канала#/shorts”, то оно просто не качает. Выдаёт как и при закачке с основного писка видео список страничек, а потом говорит что скачано 0 видео
PS E:\Video\@AnimeJK-Pop> ./yt-dlp -f ‘299+140/399+140/137+140/298+140/398+140/136+140/bestvideo[height
Кажется, это становится все более распространенной проблемой в последнее время. Можете ли вы попробовать не использовать никаких других параметров и просто выполнить простую команду, чтобы проверить, работает ли она? Например, yt-dlp https://youtube.com/@{channel}/shorts
I’m no expert, but I spent an hour on the environment variable – checked it and checked it (Windows 11) – couldn’t get it to work. But thanks for the good article.
Bonjour, je suis sous W7, quand je veux tester ffmpeg ou ffprobe après avoir suivi l’installation du tutoriel, j’obtiens ceci :
C:\Users\Daniel>ffmpeg
‘ffmpeg’ n’est aps reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
C:\Users\Daniel>ffprobe
‘ffprobe’ n’est aps reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Alors j’ai du faire une erreur mais je vois pas laquelle…
Quelqu’un peut m’aider SVP ?
Bonjour Daniel, cela semble être le même problème que celui rencontré par Ben. Vous pouvez essayer la même solution en forçant la reconnaissance du chemin ffmpeg :
yt-dlp -f bestvideo+bestaudio –merge-output-format mp4(Remplacez « C:\ffmpeg\bin » par le chemin correct vers votre installation FFmpeg.)
First off, let me just say that yt-dlp has been the best tool to use for downloading YouTube videos. I hope you guys never stop improving on it!
But now, someone threw a wrench in the works.
I tried downloading several different videos today from YouTube with yt-dlp – and I’m getting the same error:
yt-dlp -S res,ext:mp4:m4a –recode mp4 https://www.youtube.com/shorts/UQcypt8GB8A
[youtube] Extracting URL: https://www.youtube.com/shorts/UQcypt8GB8A
[youtube] UQcypt8GB8A: Downloading webpage
[youtube] UQcypt8GB8A: Downloading tv player API JSON
[youtube] UQcypt8GB8A: Downloading ios player API JSON
ERROR: [youtube] UQcypt8GB8A: Sign in to confirm you’re not a bot. Use –cookies-from-browser or –cookies for the authentication. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp for how to manually pass cookies. Also see https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies for tips on effectively exporting YouTube cookies
I found a YT video a user posted about a month ago that said “No more Youtube downloads – all platforms and browsers.”
https://www.youtube.com/watch?v=G4H0GrN2t5k
Here’s the description:
“141 views Dec 16, 2024
YouTube has stepped in and blocked all video download extensions on all browsers and operating systems.”
Will the “Sign in to confirm you’re not a bot” cookie trick work?
Hi Johnny. Just a note, but yt-dlp isn’t from us, we just wrote this article :p
Unfortunately, due to constant yt and yt-dlp changes, things often break (but are also fixed relatively quickly). The best I can recommend is to wait for the next yt-dlp update (or update now if you haven’t)
Johnny G. Did you find any solution to this, a way that each time the a cookies file will be created automatically on the headless server or anything like this
bonjour
Il semblerait que -a ‘liste.txt’ ne fonctionne plus.
J’ai essayé à peu près tout ce qui m’est venu à l’esprit rien de fonctionne. Je reçoit un “batch file ‘liste.txt’ could not be read”.
j’ai testé yt-dlp -a ‘liste.txt’, –batch-file ‘liste.txt’; -a ‘e:\Video\Yt-dlp\liste.txt’ et même -a “e:/Video/Yt-dlp/liste.txt’
rien n’y fait !
Le format a-t-il changé ?
Bonjour Bertrand, je ne peux que te recommander d’essayer de forcer un chemin absolu vers le fichier de liste (par exemple, yt-dlp -a “C:\Users\YourUsername\Videos\list.txt”) ou de mettre à jour yt-dlp.
Hi,
is there a way to check the format while executing, i.e. if format x doesn’t exist, use format y, and if that does not exist, use format z.
Example: yt-dlp –write-description –no-post-overwrite –rm-cache-dir –write-thumbnail –no-warnings –trim-filenames 200 -f mp4-360p-0 https://rumble.com/user/MY_CHANNEL 2>>log.txt
What I would like to do is, if mp4-360p-0 does not exist, use mp4-360p
Thanks!
Hi Toby, yes there is. In fact, you can specify multiple fallback formats. For example:
yt-dlp --write-description --no-post-overwrite --rm-cache-dir --write-thumbnail --no-warnings --trim-filenames 200 -f "mp4-360p-0/mp4-360p" https://rumble.com/user/MY_CHANNEL 2>>log.txt
The -f option supports fallback formats using /.
If mp4-360p-0 does not exist, yt-dlp will try mp4-360p.
If you need additional fallbacks, chain them like this:
yt-dlp -f "mp4-360p-0/mp4-360p/mp4-480p/mp4-720p"I get that his is 3 years old now but I tried this on my mac and when I use this command (copy & paste from here)
yt-dlp -f “bestvideo[ext=mp4]+bestaudio[ext=m4a]” https://www.youtube.com/watch?v=1PmJeP-TphM
and when I use it and replace the https with the url from the actual video I want I get the following error
Usage: yt-dlp [OPTIONS] URL [URL…]
yt-dlp: error: You must provide at least one URL.
Type yt-dlp –help to see a list of all options.
also tried this
yt-dlp -F –list-formats https://www.youtube.com/watch?v=9jw9W7kUBFk
yt-dlp -f ‘bv*[height=720]+ba’ https://www.youtube.com/watch?v=9jw9W7kUBFk
but I use the ID for the video I want instead of 91 (it’s still 720) but then it says the format is not available – then why did it list it in the -F –list…. command?
so now I have to download and get the mvk or webm (and sometimes weba) then combine them in VLC and convert to mp4 (vlc or handbrake) but be 100% better if I can just download the mp4 at best audio & video quality.
anyone see where this is going wrong?
Hi Gaz, couple of things you can try:
– check to see if you’re using straight quotes (” or ‘)
– Use yt-dlp’s merge-output-format option
yt-dlp -f "bv*[height=720]+ba" --merge-output-format mp4 https://www.youtube.com/watch?v=9jw9W7kUBFk– If yt-dlp can’t merge files, install FFmpeg, which handles the merging automatically:
YouTube often doesn’t provide MP4 for the best video quality; instead, it uses WebM or MKV for better compression. If you must have MP4, use:
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]" --merge-output-format mp4 https://www.youtube.com/watch?v=9jw9W7kUBFkTry this to see if you can combine everything in a working form:
yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]" --merge-output-format mp4 https://www.youtube.com/watch?v=1PmJeP-TphMHi,
I have a major concern regarding my IP address being blocked due to making multiple requests. I need to download around 400–500 videos per day. I’m open to implementing a delay of 3–5 seconds between each request and download.
Would this approach help prevent my IP from being blocked?
I would greatly appreciate any guidance or suggestions on this.
Thanks!
Hi Pavan,
Yes, implementing a delay between downloads can help reduce the risk of your IP address being blocked. However, downloading 400–500 videos per day is a high volume, and even with delays, there’s still a possibility of triggering YouTube’s automated defenses.
Hey! 👋 Great question — and yes, you’re on the right track. Adding a delay between requests can definitely help reduce the risk of getting your IP blocked.
You can do this easily with yt-dlp using the –sleep-interval and –max-sleep-interval options. For example: yt-dlp –sleep-interval 3 –max-sleep-interval 5 -a urls.txt
This will randomly sleep between 3 to 5 seconds between each download.
Also, if you’re downloading 400–500 videos daily, consider using a proxy or a seedbox to keep your home IP safe. Many users automate large-scale downloads this way while staying private and under the radar.
Let me know if you’d like help setting that up!
Cheers,
Diego
Bonjour,
je suis sous Ubuntu
Dès que je lance l’appli j’ai ce message dans le terminal :
“python app.py
2025-04-19 14:42:55,283 DEBUG (app:234) Changed format to best preset: {‘args’: [‘-f’, ‘bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b’], ‘path’: ”, ‘filename’: ‘%(title)s.%(ext)s’, ‘sponsorblock’: 0, ‘metadata’: False, ‘subtitles’: False, ‘thumbnail’: False}”
L’interface graphique apparaît bien mais quand je mets une URL comme celle-ci :
https://www.youtube.com/watch?v=9tpzIk5Polo
L’interface graphique me retourne un message d’erreur : Unable to downlaod because there are no links in the list
J’ai mis l’URL dans le champ LINK qui, dès le copier coller, me fait apparaître un croix, avant même que je demande le téléchargement.
A l’aide !
Bonjour, merci pour votre message ! L’erreur “Unable to download because there are no links in the list” indique que l’URL n’a pas été reconnue par l’application. Assurez-vous de coller une URL valide sans espace ou caractère caché (testez-la d’abord dans un éditeur de texte). Si une croix s’affiche dès le collage, cela signifie souvent que le format est rejeté par l’interface – essayez avec un autre lien YouTube pour vérifier. Aussi, vos paramètres de format contiennent des guillemets courbes (‘ ’) au lieu de guillemets droits (‘ ‘), ce qui peut poser problème : remplacez-les par ‘. Enfin, mettez à jour yt-dlp avec python3 -m pip install -U yt-dlp, puis testez la commande directement dans le terminal pour voir si le souci vient de l’interface.
yt-dlp problems:
1. drm protected videos:
WARNING: [youtube] EHevgEKGwhY: Some tv client https formats have been skipped as they are DRM protected.
2. when I tried to download playlist with subitles, no subtitles were downloaded:
yt-dlp –verbose –cookies-from-browser firefox –write-auto-sub –sub-lang “en.*” –no-check-certificates –no-part –yes-playlist “https://www.youtube.com/watch?blababla”
Hi Sasa,
1. Regarding the DRM issues – this is normal. YouTube protects certain streams with DRM that can’t be downloaded. yt-dlp will automatically use the best available non-DRM format instead.
2. Try changing –write-auto-sub to –write-subs in your command. Auto-subs and regular subtitles are handled differently. You can also add both flags if it doesn’t work.
Como cambiar los fbps de un archivo de solo audio
¡Hola! Si deseas cambiar la calidad (kbps) de un archivo de solo audio con yt-dlp, puedes usar el parámetro –audio-quality.
Por ejemplo:
yt-dlp -x –audio-format mp3 –audio-quality 128K
Esto descargará solo el audio y lo convertirá a MP3 con 128 kbps.
También asegúrate de tener ffmpeg instalado, ya que yt-dlp lo usa para convertir archivos de audio.
¡Espero que te sirva!
Quick question, under the environmental variables when I click on “edit” it only brings up a box to edit the existing path and does not have the option of adding a new one like the example shows. Is there something else I might be missing? I’m using an up to date windows 10 system.
Thank you!
Hi J,
On Windows 10, the Path variable isn’t created by you—it exists already. When you click Edit, it opens a window where you manage individual folder entries. To add your own path (e.g. the folder where yt-dlp.exe resides), follow these steps:
Open Edit the system environment variables from the Start menu.
Click Environment Variables…
Under your User variables (or System variables), select Path and click Edit.
In the popup, click New, then enter the folder path containing yt-dlp.exe—don’t include the .exe itself.
Click OK in all dialogs to save.
Close and reopen your Command Prompt or PowerShell, then test by typing yt-dlp—it should now run from any directory.
Let me know if it still doesn’t show up. I’ll be happy to help further.
Hey J!
On some Windows 10 setups the editor just shows one long line of paths instead of the list with “Add New.” No worries, just go to the end of that line, add a semicolon ;, then paste your new path (e.g. C:\PATH_Programs-ytdlp\ffmpeg\bin). Hit OK, and you’re good to go! Later on, you can try openning a new Command Prompt and try ffmpeg -version to make sure it worked. 👍
I hope that works!
Diego
Hello guys ,
I am facing issue downloading files using yt-dlp on my remove server machine it is givving me this error
ERROR: [youtube] h3uDCJ5mvgw: Sign in to confirm you’re not a bot. Use --cookies-from-browser or --cookies for the authentication. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp for how to manually pass cookies. Also see https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies for tips on effectively exporting YouTube cookies
i am not seeing any work aroud for this ,pleae help me with this is therer ay way except teh one with cookies implementation otther than that . like proxy or something.
Hey Aditya 👋 … this error is happening because YouTube now asks you to prove you’re a real logged-in user. A proxy alone might now help get past it. The site wants to see cookies from a real session… there is quick fix you can try: export your cookies from your browser and use them on the server:
yt-dlp –cookies-from-browser chrome –cookies cookies.txt
scp cookies.txt user@server:/home/user/
yt-dlp –cookies /home/user/cookies.txt “https://youtube.com/watch?v=VIDEO_ID”
Refresh the cookies whenever downloads stop working. That’s the most reliable way around the “sign in” wall.
Hope that helps Aditya!
Diego
Hola lo hago todo tal cual, incluyendo los comandos para loggearme pero obtengo este error:
[download] Unable to open file: [Errno 13] Permission denied: ‘ACF_LaGuitarraFlamencaDeYeraiCortes_FTR_1080p25_H264_20VO_VIMEO [1138536621].fhls-fastly_skyfire-5206.mp4.ytdl’. Retrying (1/3)…
[download] Unable to open file: [Errno 13] Permission denied: ‘ACF_LaGuitarraFlamencaDeYeraiCortes_FTR_1080p25_H264_20VO_VIMEO [1138536621].fhls-fastly_skyfire-5206.mp4.ytdl’. Retrying (2/3)…
[download] Unable to open file: [Errno 13] Permission denied: ‘ACF_LaGuitarraFlamencaDeYeraiCortes_FTR_1080p25_H264_20VO_VIMEO [1138536621].fhls-fastly_skyfire-5206.mp4.ytdl’. Retrying (3/3)…
ERROR: Unable to download video: [Errno 13] Permission denied: ‘ACF_LaGuitarraFlamencaDeYeraiCortes_FTR_1080p25_H264_20VO_VIMEO [1138536621].fhls-fastly_skyfire-5206.mp4.ytdl’
Hola Daniel,
Ese error normalmente significa que yt-dlp no tiene permiso para escribir el archivo en la carpeta donde estás descargando.
Prueba lo siguiente:
Cambia de carpeta antes de ejecutar el comando, por ejemplo:
cd ~/Downloads
O especifica un nombre de archivo manualmente:
yt-dlp -o “%(title)s.%(ext)s” URL
Si usas Windows, asegúrate de que la carpeta no está protegida o abre la terminal como Administrador.
Si el archivo ya existe y está bloqueado, bórralo o cambia el nombre:
yt-dlp -o “video.mp4” URL
Si quieres, muéstrame el comando exacto que usas y te digo la solución exacta.
Hi, can someone explain me what this eeror doe’s mean?
e:\Projects\JavaScript\ytdl_test>yt-dlp.exe https://www.youtube.com/shorts/mnMhCtXIJMM
[youtube] Extracting URL: https://www.youtube.com/shorts/mnMhCtXIJMM
[youtube] mnMhCtXIJMM: Downloading webpage
WARNING: [youtube] No supported JavaScript runtime could be found. Only deno is enabled by default; to use another runtime add –js-runtimes RUNTIME[:PATH] to your command/config. YouTube extraction without a JS runtime has been deprecated, and some formats may be missing. See https://github.com/yt-dlp/yt-dlp/wiki/EJS for details on installing one
[youtube] mnMhCtXIJMM: Downloading android sdkless player API JSON
[youtube] mnMhCtXIJMM: Downloading web safari player API JSON
WARNING: [youtube] mnMhCtXIJMM: Some web_safari client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See https://github.com/yt-dlp/yt-dlp/issues/12482 for more details
[youtube] mnMhCtXIJMM: Downloading m3u8 information
WARNING: [youtube] mnMhCtXIJMM: Some web client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See https://github.com/yt-dlp/yt-dlp/issues/12482 for more details
WARNING: ffmpeg not found. The downloaded format may not be the best available. Installing ffmpeg is strongly recommended: https://github.com/yt-dlp/yt-dlp#dependencies
[info] mnMhCtXIJMM: Downloading 1 format(s): 96
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 4
[download] Destination: #endall 昨年の今頃(?)は"BREAKIN’ IT FASTER"の制作真っ最中でございました🎸🎧楽しいレコーディングでございました!#rock #metal #レコーディング [mnMhCtXIJMM].mp4
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (1/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (2/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (3/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (4/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (5/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (6/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (7/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (8/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (9/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 1 (10/10)…
[download] fragment not found; Skipping fragment 1 …
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (1/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (2/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (3/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (4/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (5/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (6/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (7/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (8/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (9/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 2 (10/10)…
[download] fragment not found; Skipping fragment 2 …
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (1/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (2/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (3/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (4/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (5/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (6/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (7/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (8/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (9/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 3 (10/10)…
[download] fragment not found; Skipping fragment 3 …
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (1/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (2/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (3/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (4/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (5/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (6/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (7/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (8/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (9/10)…
[download] Got error: HTTP Error 403: Forbidden. Retrying fragment 4 (10/10)…
[download] fragment not found; Skipping fragment 4 …
ERROR: The downloaded file is empty
I managed to download few 2-3 videos before im started to get this error. Does it mean my IP is blocked by YT servers?
Hi BC,
Based on the warnings, try the following:
1. Update yt-dlp (and consider nightly, too):
yt-dlp -U
or yt-dlp –update-to nightly
2. Install + enable a JS runtime:
then run with –js-runtimes deno (or node).
Avoid the problematic web client/SABR path by forcing another client:
yt-dlp –extractor-args “youtube:player_client=android” “URL”
If the video works in your browser but still fails in yt-dlp, try passing cookies (this can help when YouTube starts treating CLI downloads as suspicious):
yt-dlp –cookies-from-browser chrome “URL” (or –cookies cookies.txt)
If you’re doing many downloads: add a small pacing:
–sleep-interval 2 –max-sleep-interval 5
Hope this helps!
im on windows an ive spent the last 3 hrs to download a video with audio but im always getting seperate files webm and mp4 i use vlc and i cant add the audio to the video
Hi baby,
It sounds like FFmpeg isn’t installed or yt-dlp can’t find it. Many sites (like YouTube) provide video and audio separately, and yt-dlp uses FFmpeg to merge them.
Download FFmpeg, extract it, put ffmpeg.exe in the same folder as yt-dlp.exe and try again 🙂