name conflict with stream.exe... whatever that is

This commit is contained in:
secretspecter 2023-06-28 12:32:29 -06:00
parent 3aba831f2c
commit b2e1ead4c7

23
Scripts/Stream-Video.ps1 Normal file
View file

@ -0,0 +1,23 @@
param(
[string]$url = "",
[string]$record = "~/Videos/Streamed/{title}.ts",
[int]$retryinterval = 30,
[string]$quality = "best",
[switch]$norecord
)
if ($url) {
if (-not (Get-Command "streamlink" -ErrorAction SilentlyContinue)) {
Write-Host "There's no streamlink to work with!"
exit
}
$streamlink_opts = "--default-stream $quality"
$streamlink_opts += " --retry-streams $retryinterval"
if ($record -and -not $norecord) {
$streamlink_opts += " --record $record"
}
Write-Host "streamlink $streamlink_opts $url"
Start-Process streamlink -ArgumentList "$streamlink_opts $url"
}