Created
September 8, 2024 12:02
-
-
Save fourst4r/69a3b3b699d8e5249b7ea3f8a66c04a8 to your computer and use it in GitHub Desktop.
Script to record twitch streams with streamlink (neem's movie night)
This file contains 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
param ( | |
[string]$username | |
) | |
while ($true) { | |
$timestamp = [DateTimeOffset]::Now.ToUnixTimeSeconds() | |
$videosDir = "$env:USERPROFILE\Videos\$username" | |
if (-not (Test-Path -Path $videosDir)) { | |
New-Item -Path $videosDir -ItemType Directory | Out-Null | |
Write-Host "Created directory: $videosDir" | |
} | |
$command = "streamlink twitch.tv/$username best -o '$videosDir\${username}_$timestamp.mp4' --stream-segment-attempts 1000 --stream-segment-timeout 10" | |
Write-Host "Running command: $command" | |
Invoke-Expression $command | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment