Skip to content

Commit 6467290

Browse files
committed
fix: ERROR: [youtube] Requested format is not available.
1 parent 843161b commit 6467290

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

powershell/yt-download.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ New-Variable -Name templateNameTitle -Value "%(title).70s.%(ext)s" -Option Const
4848
# if useTitle is true then use $templateNameTitle else $templateNameChannel
4949
New-Variable -Name useTitle -Value $true -Option Constant
5050
# defaut quality for video (make it compatible to upload on 𝕏)
51-
New-Variable -Name videoQuality -Value "bestvideo[vcodec^=avc1]+bestaudio[ext=m4a]/bestvideo+bestaudio"
51+
New-Variable -Name videoQuality -Value "bestvideo*[vcodec^=avc1]+bestaudio*[acodec^=mp4a]/bestvideo*+bestaudio*/best"
5252
# Videos will use this container
5353
New-Variable -Name videoContainer -Value "mp4" -Option Constant
5454
# set URLs for which the script will detect as audio
@@ -384,15 +384,15 @@ if ($url -and -not $install -and -not $uninstall) {
384384
"--audio-format", "mp3",
385385
"--audio-quality", "0",
386386
"-o", "$output",
387-
"-f", "bestaudio[ext=mp3]/bestaudio/bestvideo+bestaudio",
387+
"-f", "bestaudio[ext=mp3]/bestaudio*/bestvideo*+bestaudio*",
388388
$DL_URL
389389
)
390390
}
391391
else {
392392
$global:options = @(
393393
"--extract-audio",
394394
"-o", "$output",
395-
"-f", "bestaudio[ext=$QUALITY]/bestaudio/bestvideo+bestaudio",
395+
"-f", "bestaudio*[ext=$QUALITY]/bestaudio*/bestvideo*+bestaudio*",
396396
$DL_URL
397397
)
398398
}
@@ -402,10 +402,10 @@ if ($url -and -not $install -and -not $uninstall) {
402402

403403
if ($QUALITY) {
404404
if ($QUALITY -ieq "best") {
405-
$videoQuality = "bestvideo+bestaudio/best"
405+
$videoQuality = "bestvideo*+bestaudio*/best"
406406
}
407407
else {
408-
$videoQuality = "bestvideo[vcodec^=avc1][height<=$QUALITY]+bestaudio[ext=m4a]/bestvideo[height<=$QUALITY]+bestaudio/best"
408+
$videoQuality = "bestvideo*[vcodec^=avc1][height<=$QUALITY]+bestaudio*[acodec=mp4a]/bestvideo*[height<=$QUALITY]+bestaudio*/best"
409409
}
410410
}
411411
$global:options = @(

0 commit comments

Comments
 (0)