🟥 Prerequisites

  1. You have to have python installed in your machine.
  2. keep this exe on “C:\Windows\System32” folder
    Transclude of yt-dlp.exe
  3. Install yt-dlp using the following command:
    pip install yt-dlp

🟥 AHK script version by _ashraful

  1. install Autohotkey on your machine
    Transclude of AutoHotkey_1.1.37.01_setup-1.exe
  2. download this script
    Transclude of ytdl_downloader_by_ashraful.ahk
  3. now every time you run this script you can download using GUI

🟥 simple cli way

👉 Youtube playlist/single video

yt-dlp -P "folder path" -f "137+140" --sleep-interval 3 --max-sleep-interval 8 "playlist link / single video link"

example:

  • for 1080p
yt-dlp -P "D:\downloades" -f "137+140" --sleep-interval 3 --max-sleep-interval 8 "https://www.youtube.com/playlist?list=PLu71SKxNbfoBGh_8p_NS-ZAh6v7HhYqHW"
  • for downloading best quality and large file.. more time
yt-dlp -P "D:\downloades" -f "bestvideo+bestaudio" --sleep-interval 3 --max-sleep-interval 8 "https://www.youtube.com/playlist?list=PLu71SKxNbfoBGh_8p_NS-ZAh6v7HhYqHW"

👉 Bilibili playlist or single video

yt-dlp -P "folder path" -f "bestvideo+bestaudio" --sleep-interval 3 --max-sleep-interval 8 "playlist name with playlist code from bilibili"

example: (please keep the link simple with the video code only)

yt-dlp -P "D:\downloads" -f "bestvideo+bestaudio" --sleep-interval 3 --max-sleep-interval 8 "https://www.bilibili.com/video/BV1gH4y1M7os"

⚠️ Extra resources

Steps to Download Videos

1. Open Command Prompt as Administrator

  • Press Win + S and search for “cmd”.
  • Right-click on “Command Prompt” and select “Run as administrator.”

2. Check Available Formats (Optional)

Before downloading, you can list all available formats for a video:

yt-dlp -F "https://www.bilibili.com/video/BV1gH4y1M7os"

3. Download a Single Video

To download a single video in the best available format:

  • youtube:
yt-dlp -f "best" -P "<DOWNLOAD_PATH>" "<VIDEO_URL>"
  • billibilli
yt-dlp -f "30080+30216" -P "<DOWNLOAD_PATH>" "<VIDEO_URL>"

4. Download a Playlist (Bilibili or YouTube)

  • youtube:
yt-dlp -P "<DOWNLOAD_PATH>" -f "best" "<PLAYLIST_URL>"
  • billibilli:
yt-dlp -P "<DOWNLOAD_PATH>" -f "30080+30216" "https://www.bilibili.com/video/BV1gH4y1M7os"

5. Download Specific Videos from a Playlist

To download specific videos (e.g., videos 10 to 20):

yt-dlp -P "<DOWNLOAD_PATH>" -f "best" --playlist-start 10 --playlist-end 20 "<PLAYLIST_URL>"

6. Use Random Delays Between Downloads

To reduce the risk of being rate-limited, add a random delay:

yt-dlp --sleep-interval 3 --max-sleep-interval 8 -P "<DOWNLOAD_PATH>" -f "best" "<PLAYLIST_URL>"
  • This will add a delay of 3 to 8 seconds between downloads.

7. Use Cookies for Restricted Content

If a video or playlist requires login credentials, use browser cookies:

yt-dlp --cookies-from-browser chrome -P "<DOWNLOAD_PATH>" -f "best" "<VIDEO_URL>"
  • Replace chrome with your browser (e.g., firefox, edge) if using a different one.

Additional Tips

  1. To customize filenames, use the -o option:
    yt-dlp -o "%(title)s.%(ext)s" -P "<DOWNLOAD_PATH>" -f "best" "<VIDEO_URL>"
  2. Resume an interrupted download by simply rerunning the same command you ran at the beginning. it will check if the file/ files are downloaded or not.. then it will download the rest of the files. yt-dlp will pick up where it left off.

Example Commands

Download a Bilibili Playlist in 1080p:

yt-dlp -P "D:\\Videos\\Bilibili" -f "30080+30216" --sleep-interval 3 --max-sleep-interval 8 "https://www.bilibili.com/video/BV1gH4y1M7os"

Download a YouTube Video in Best Quality:

yt-dlp -P "D:\\Videos\\YouTube" -f "best" "https://www.youtube.com/watch?v=example"

Example of bilibili

yt-dlp -P "D:\mass downloader\[NEW] Master Microservices with SpringBoot,Docker,Kubernetes" -f "30080+30216" --sleep-interval 3 --max-sleep-interval 8 "https://www.bilibili.com/video/BV1gH4y1M7os"

Example of youtube playlist 1080

yt-dlp -P "folder path" -f "137+140" --sleep-interval 3 --max-sleep-interval 8 "playlist link"