Skip to content

Instantly share code, notes, and snippets.

@lambdan
Created May 10, 2026 15:16
Show Gist options
  • Select an option

  • Save lambdan/10b38de6544b9d9c9fa4df1c6b3dccbd to your computer and use it in GitHub Desktop.

Select an option

Save lambdan/10b38de6544b9d9c9fa4df1c6b3dccbd to your computer and use it in GitHub Desktop.
Set up tools in Windows path
# Make c:\path
# Add it to $PATH
# Put this script in c:\path and run it :)
# Currently installs ffmpeg/ffprobe/ffplay, yt-dlp
$YTDLP_URL = "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe"
$YTDLP_TARGET = "./yt-dlp.exe"
$FFMPEG_URL = "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip"
$FFMPEG_TARGET_ZIP = "./tmp_ffmpeg.zip"
$FFMPEG_TARGET_EXE = "./ffmpeg.exe"
function DownloadIfNotExists {
param (
[Parameter(Mandatory)]
[string]$Url,
[Parameter(Mandatory)]
[string]$Target
)
if (Test-Path $Target) {
Write-Host $Target already exists!
} else {
Write-Host Downloading $Url
# disable progress bar temporarily to speed up download
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest $Url -OutFile tmp_download
move tmp_download $Target
$ProgressPreference = 'Continue' # restore progress bar
}
}
# yt-dlp
DownloadIfNotExists $YTDLP_URL $YTDLP_TARGET
# ffmpeg
if (Test-Path $FFMPEG_TARGET_EXE) {
Write-Host $FFMPEG_TARGET_EXE "already exists"
} else {
DownloadIfNotExists $FFMPEG_URL $FFMPEG_TARGET_ZIP
Expand-Archive $FFMPEG_TARGET_ZIP -DestinationPath ./tmp_ffmpeg
move ./tmp_ffmpeg/*/bin/* .
remove-item ./tmp_ffmpeg -recurse
remove-item $FFMPEG_TARGET_ZIP
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment