Skip to content

Commit 4e77466

Browse files
committed
fix: check ffmpeg installation
Display a more useful error message
1 parent 571ac2b commit 4e77466

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

powershell/yt-download.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function Test-AdminPrivileges {
160160

161161
function Test-YtdlInstallation {
162162
if (-not (Get-Command yt-dlp -ErrorAction SilentlyContinue)) {
163-
TerminateWithError -errorMessage "yt-dlp is not installed globally on the system. Install it or add it to the PATH."
163+
TerminateWithError -errorMessage "yt-dlp is not installed globally on the system. Install it or add it to the PATH. You may need to restart the browser from where you call the command"
164164
}
165165
}
166166

@@ -182,6 +182,11 @@ function Get-YtdlPath {
182182

183183
}
184184

185+
function Test-FFmpegInstallation {
186+
if (-not (Get-Command ffmpeg -ErrorAction SilentlyContinue)) {
187+
TerminateWithError -errorMessage "FFmpeg is not installed globally on the system. Install it or add it to the PATH. You may need to restart the browser from where you call the command."
188+
}
189+
}
185190
<#*==========================================================================
186191
* ℹ           GET PARAMETERS
187192
===========================================================================#>
@@ -277,6 +282,12 @@ if ($url -and -not $install -and -not $uninstall) {
277282

278283
Test-YtdlInstallation
279284

285+
<#*==========================================================================
286+
* ℹ CHECK FFMPEG INSTALLATION
287+
===========================================================================#>
288+
289+
Test-FFmpegInstallation
290+
280291
<#*==========================================================================
281292
* ℹ TEST URL to download
282293
===========================================================================#>

0 commit comments

Comments
 (0)