A PowerShell-based YouTube downloader powered by yt-dlp.
A PowerShell script for conveniently downloading YouTube videos/audio and encoding video into high quality.
- One-file installer
- Automatic yt-dlp installation
- Automatic FFmpeg installation
- Video & audio download
- Playlist support
- Subtitle download
- Automatic update check
- Place the
run_ytall.ps1file in a location of your choice (e.g., your desktop). - Right-click the
run_ytall.ps1file and select [Run with PowerShell].Set-ExecutionPolicy -Scope CurrentUser RemoteSigned- On first run, the script will automatically create the
ytallfolder and download/install all required files. (The original file is automatically deleted after installation.)
- Agree to the legal notice (EULA) by typing
y, then choose whether to create a desktop shortcut (yorn) to complete installation. - Once installation finishes, the
README.mdfile opens automatically. (Important: please read it at least once!) - Add the YouTube links you want to download to
mp3.txtormp4.txtinside theytallfolder and save. - Run the
YTallshortcut created on your desktop, orYTall.batinside theytallfolder, to start downloading.
To download videos that require sign-in or age verification, you need to copy your browser's cookie values into the details/cookies.txt file. Choose one of the methods below.
Note: Cookies may contain sensitive personal information, so never share this file with anyone else.
The most convenient method is to use an extension that easily exports cookies to a file.
-
Chrome / Microsoft Edge: (Edge is built on the same base as Chrome, so it supports most extensions from the Chrome Web Store.)
- Install the Get cookies.txt LOCALLY extension. (Team lead's recommendation)
- Open the YouTube page you want to get cookies from.
- Click the extension icon (lock shape) next to the address bar, then click [Export].
- The
cookies.txtfile will be downloaded. - Copy the entire contents of the downloaded
cookies.txtfile, then paste it over (overwrite) thecookies.txtfile located in theytall/details/folder and save.
-
Firefox:
- Install a cookie-export add-on such as cookies.txt.
- Open the YouTube page you want to get cookies from.
- Click the cookie-shaped icon next to the address bar, then click "Download cookies.txt".
- The
cookies.txtfile will be downloaded. - Copy the entire contents of the downloaded
cookies.txtfile, then paste it over (overwrite) thecookies.txtfile located in theytall/details/folder and save.
- Open the YouTube page containing the video you want to download.
- Press F12 on your keyboard to open Developer Tools.
- Click the [Network] tab.
- Refresh the page (F5).
- Click on an item in the list that starts with
watch?v=. - In the right pane, select the [Headers] tab and scroll to the Request Headers section.
- Find the
cookie:entry and copy the entire value. - Paste it into
ytall/details/cookies.txtand save.
- Open the YouTube page containing the video you want to download.
- Press F12 to open Developer Tools.
- Click the [Network] tab and refresh the page (F5).
- Click on an item that starts with
watch?v=. - In the right pane, select the [Headers] tab and find Request Headers.
- Right-click the
Cookieentry's value and select [Copy All]. - Paste it into
ytall/details/cookies.txtand save.
You can edit the details/config.ini file to control several behaviors of the script.
- Encoder: Choose the
gpu(NVIDIA) orcpuencoder. (Automatically falls back to cpu if no NVIDIA graphics card is present.) - Resolution: Specifies the vertical resolution of the video (e.g., 720, 1080).
- MaxRate: Limits the maximum bitrate during encoding to prevent the file size from becoming excessively large (e.g., 5M, 10M).
- GpuCq: GPU encoding quality (lower = higher quality; recommended: 20-25).
- GpuPreset: GPU encoding speed/quality balance.
p1(fastest) ~p7(best quality). - CpuCrf: CPU encoding quality (lower = higher quality; recommended: 22-28).
- CpuPreset: CPU encoding speed/compression ratio.
ultrafast~veryslow.
- EnableEncoding: If set to
true, downloaded MP4 videos are re-encoded with the HEVC (H.265) codec. If set tofalse, the encoding step is skipped and the original downloaded file is used as-is. - ProcessPlaylists: If set to
true, whenmp3.txtormp4.txtcontains a playlist link, every video/audio track in the playlist is downloaded. If left asfalse, only the single video from the playlist link itself is downloaded.- Note: Once a playlist link has been processed, it is automatically removed from the list file; if some videos failed, only the individual links for those failed videos remain. So if new videos are later added to the playlist, you'll need to re-add the original playlist link to the list file to fetch them.
- PlaySoundOnComplete: If set to
true, a completion notification sound plays once all jobs are finished. - MinFreeSpaceGB: Specifies the minimum required free disk space (GB) when the script runs. If available space is less than this, the job is halted for safety.
- EmbedThumbnail: If set to
true, the video's thumbnail is automatically fetched and embedded as album art when downloading MP3. - EmbedMetadata: If set to
true, metadata such as song title, artist, and composer is automatically written inside the MP3 file.
If you enjoyed this project, please consider sending the developer a little support. It's a huge help in building better projects!