Prerequisites - Fred-Vatin/run-yt-dlp-from-browser GitHub Wiki

(Optional but recommended) Install a Nerd Font

Nerd Fonts patches developer targeted fonts with a high number of glyphs (icons). Specifically to add a high number of extra glyphs from popular ‘iconic fonts’ such as Font Awesome, Devicons, Octicons, and others.

It will provide a better experience if you use it in your terminal or code editor, allowing you to use lots of icons and glyphs.

I suggest you to install FiraCode Nerd Font because this font is well known and has features like ligatures and provides all letters for all languages. Don’t download the FiraMono flavor.

image


Using Windows Terminal

Install

Windows Terminal is already installed on Windows 11.

On Windows 10, you need to install it. Just open the Microsoft Store and look for Windows Terminal or click this this link and open it in the store.


(Optional but recommended) Install UniGetUI

If an application can be installed using the Winget command line, this UI can be helpful to search/install/update Windows/Python/Powershell/Rust/NodeJS applications and packages.

So while you are in the Microsoft Store, install UniGetUI.


Install Powershell 7

Use one of these install methods.

Using UniGetUI

image

Install the winget version as administrator. Be sure to select the one whose ID is Microsoft.Powershell. image

Using Winget

Open a terminal as administrator and use this command

winget install -e --id Microsoft.PowerShell --scope machine

--scope machine tells winget to install Powershell for all users.


Setup Terminal to use Powershell 7

After you install Pwsh 7, reboot if you’re asked to. Then open Window Terminal. You need to add a profile for Pwsh.

Open the settings.

image

First, set up the default profile appearance using FiraCode Nerd Font. image image

This can be useful but if you find it is too intrusive, change it to Close only when process exists successfully image

Add a new profile image

Set it up like this image

  • Name: Powershell 7 (or pwsh if you prefer)
  • Command line: pwsh
  • Icon: ms-appx:///ProfileIcons/pwsh.png

Duplicate this profile and name it: Powershell 7 [admin]. Check the Run this profile as administrator.

(optional) Set it as the default at startup image

Windows Terminal should have added some other profiles. Select the one named Command prompt or CMD. Set it up like this: image


Allow Powershell scripts to run

Open your terminal. It should open a tab with your pwsh profile by default. If not, open a new tab with the pwsh profile. image

Run the command Get-ExecutionPolicy -Scope LocalMachine. If the output is not RemoteSigned then run this command:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

If later, you still have problem to run .ps1 script, re-run those commands changing the scope for -Scope CurrentUser.


Install yt-dlp and its dependencies on your OS globally

Use one of these methods.

Using UniGetUI

First, you also need to install ffmpeg. FFmpeg is required by yt-dlp to handle audio and video post-processing, such as merging separate audio/video streams, converting formats, or embedding metadata. It acts as a powerful backend for these essential tasks after the initial download. Be sure to install the winget version:

image

Then install yt-dlp

image

Using Winget

Run those commands successively in your terminal (DO NOT RUN IT as administrator), using pwsh profile.

winget.exe install --id "Gyan.FFmpeg" --exact --source winget --accept-source-agreements --disable-interactivity --silent  --accept-package-agreements --force
winget.exe install --id "yt-dlp.yt-dlp" --exact --source winget --accept-source-agreements --disable-interactivity --silent  --accept-package-agreements --force  

Check yt-dlp installation

Before anything, sign out from Windows and sign in to be sure to reload all system variables.

If your terminal was opened, open a new tab with your pwsh profile and run those commands successively:

yt-dlp --update

It should output something like

Latest version: [email protected] from yt-dlp/yt-dlp
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp)

or update to the last version.

Run

ffmpeg -version

If those commands returns an error like yt-dlp or ffmpeg is not known as a command, then open your file explorer paste %LocalAppData%\Microsoft\WinGet\Packages in the address bar and press Enter. You should check the folder names.

image

If there is no yt-dlp and ffmpeg, then install failed. Try to install again using winget method above and check if there are errors returned in the terminal during install.

If the folders exist and contain the expected .exe files, then the problem is there were not added to the user path.

Check path

Download Rapid Environment Editor zip or setup.exe. Right click the package and be sure to unblock if necessary.

image

Install and run as administrator. Unfold user path and check if path to yt-dlp and ffmpeg exist.

image

If not, add them. Right click on path and select add value. After you checked those paths exist in your file explorer and contain the .exe, add them one by one:

%localappdata%\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-7.1.1-full_build\bin
%localappdata%\Microsoft\WinGet\Packages\yt-dlp.yt-dlp_Microsoft.Winget.Source_8wekyb3d8bbwe

Don’t forget to save:

image

Sign out/sign in again in Windows and check again if it works.


(optional) install YDL-UI

YDL-UI provides a simplified way to download videos using "yt-dl", without the hassle of using the command-line. This is achieved by dynamically generating youtube-dl argument queries that can be run with a click of a button. YDL-UI is packaged with a release of yt-dl and ffmpeg.

Download YDL-UI and put in a location where it won’t move. Then edit the UI_Path value in the yt-download.ps1 script.

My scripts can use this app. Sometimes it can help to easily tweak the format you want to download. The downside is, as I write those lines, it can not use the yt-dl and ffmpeg installed globally on your system by default. It is a portable app and already provides .exe files in the bin folder. But they are outdated.

image

So you can simply delete the bin folder content and open the settings to set the absolute paths to the .exe installed by winget.

  • ffmpeg: %LocalAppData%\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-7.1.1-full_build\bin\ffmpeg.exe
  • yt-dlp: %LocalAppData%\Microsoft\WinGet\Packages\yt-dlp.yt-dlp_Microsoft.Winget.Source_8wekyb3d8bbwe\yt-dlp.exe

Update the ffmpeg path because it changes when it is updated.


Install Tampermonkey on your browser

Just go to https://www.tampermonkey.net and install the first one.