Skip to content

Instantly share code, notes, and snippets.

@jahands
Last active January 23, 2016 18:33
Show Gist options
  • Save jahands/16d0030aa56f5b1f4a72 to your computer and use it in GitHub Desktop.
Save jahands/16d0030aa56f5b1f4a72 to your computer and use it in GitHub Desktop.
A wrapper for livestreamer which adds looping functionality
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,Position=1)]
[string]$StreamName,
[Parameter(Position=2)]
[int]$Quality=1,
[Parameter()]
[bool]$Retry=$true,
[Parameter()]
[int]$RetryTimeout=10
)
$qualitySetting=@(
"audio",
"source",
"high",
"medium",
"low",
"mobile"
)
do{
livestreamer.exe $("twitch.tv/"+$StreamName) $qualitySetting[$Quality]
if($Retry){
Write-Output $("Waiting "+$RetryTimeout+" seconds before retrying...")
sleep $RetryTimeout
}
}while($Retry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment