Last active
January 23, 2016 18:33
-
-
Save jahands/16d0030aa56f5b1f4a72 to your computer and use it in GitHub Desktop.
A wrapper for livestreamer which adds looping functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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