23 lines
585 B
PowerShell
23 lines
585 B
PowerShell
param(
|
|
[string]$url = "",
|
|
[validatescript({ Test-Path $_ -PathType Container })]
|
|
[system.io.fileinfo]$out = "~/Videos/Downloads/",
|
|
[string]$namepattern = "%(title)s",
|
|
[int]$wait = 60 * 10
|
|
)
|
|
|
|
$ytdlp_options = "--live-from-start --sponsorblock-remove all"
|
|
$ytdlp_options += " --wait-for-video $wait"
|
|
$ytdlp_options += " --output $out$namepattern.%(ext)s"
|
|
|
|
if ($url) {
|
|
Start-Process yt-dlp -ArgumentList "$ytdlp_options $url"
|
|
}
|
|
else {
|
|
while ($true) {
|
|
$url = Read-host “URL”
|
|
if (!$url) { break }
|
|
Start-Process yt-dlp -ArgumentList "$ytdlp_options $url"
|
|
}
|
|
}
|