# ClipForge Helper installer for Windows. # Open PowerShell (Start menu -> type "PowerShell") and paste: # irm https://clips.thegridreport.news/helper/install-windows.ps1 | iex # Installs (free, open source) into %LOCALAPPDATA%\ClipForgeHelper: # yt-dlp.exe (github.com/yt-dlp/yt-dlp), ffmpeg.exe (github.com/yt-dlp/FFmpeg-Builds), # deno.exe (github.com/denoland/deno) and a "ClipForge Helper" shortcut on your Desktop. $ErrorActionPreference = "Stop" $ProgressPreference = "SilentlyContinue" try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 } catch {} $Server = if ($env:CLIPFORGE_SERVER) { $env:CLIPFORGE_SERVER.TrimEnd('/') } else { "https://clips.thegridreport.news" } $Dir = if ($env:CLIPFORGE_HOME) { $env:CLIPFORGE_HOME } else { Join-Path $env:LOCALAPPDATA "ClipForgeHelper" } $Bin = Join-Path $Dir "bin" New-Item -ItemType Directory -Force -Path $Bin, (Join-Path $Dir "downloads") | Out-Null Add-Type -AssemblyName System.IO.Compression.FileSystem function Fetch($url, $dest) { Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $dest } function Extract-Exe($zip, $names) { $z = [IO.Compression.ZipFile]::OpenRead($zip) try { foreach ($e in $z.Entries) { if ($names -contains $e.Name) { [IO.Compression.ZipFileExtensions]::ExtractToFile($e, (Join-Path $Bin $e.Name), $true) } } } finally { $z.Dispose() } Remove-Item -Force $zip } Write-Host "Installing ClipForge Helper into $Dir" -ForegroundColor Yellow Write-Host "- yt-dlp"; Fetch "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" (Join-Path $Bin "yt-dlp.exe") Write-Host "- ffmpeg (big download, may take a few minutes)" $fz = Join-Path $Dir "ffmpeg.zip" Fetch "https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip" $fz Extract-Exe $fz @("ffmpeg.exe", "ffprobe.exe") Write-Host "- deno" $dz = Join-Path $Dir "deno.zip" Fetch "https://github.com/denoland/deno/releases/latest/download/deno-x86_64-pc-windows-msvc.zip" $dz Extract-Exe $dz @("deno.exe") Write-Host "- ClipForge Helper script" $script = Join-Path $Dir "clipforge-helper.ps1" Fetch "$Server/helper/clipforge-helper.ps1" $script try { Get-ChildItem -LiteralPath $Dir -Recurse -File | Unblock-File -ErrorAction SilentlyContinue } catch {} # Desktop shortcut $desktop = [Environment]::GetFolderPath("Desktop") if (-not $desktop) { $desktop = Join-Path $HOME "Desktop" } New-Item -ItemType Directory -Force -Path $desktop | Out-Null $lnk = Join-Path $desktop "ClipForge Helper.lnk" $ws = New-Object -ComObject WScript.Shell $s = $ws.CreateShortcut($lnk) $s.TargetPath = "$env:WINDIR\System32\WindowsPowerShell\v1.0\powershell.exe" $s.Arguments = "-NoProfile -ExecutionPolicy Bypass -File `"$script`"" $s.WorkingDirectory = $Dir $s.Description = "Download a YouTube video at home and send it to ClipForge" $s.Save() Write-Host "" Write-Host "Checking the tools work..." $fail = $false try { $v = & (Join-Path $Bin "yt-dlp.exe") --version; Write-Host " yt-dlp OK ($v)" } catch { Write-Host " yt-dlp FAILED"; $fail = $true } try { & (Join-Path $Bin "ffmpeg.exe") -version | Out-Null; Write-Host " ffmpeg OK" } catch { Write-Host " ffmpeg FAILED"; $fail = $true } try { & (Join-Path $Bin "deno.exe") --version | Out-Null; Write-Host " deno OK" } catch { Write-Host " deno not working (usually still fine)" } Write-Host "" if ($fail) { Write-Host "Something didn't install right. Take a screenshot of this window and send it to whoever set this up." -ForegroundColor Red } else { Write-Host "Done! Your Desktop now has a 'ClipForge Helper' icon. Copy a YouTube link, double-click it, press Enter." -ForegroundColor Green }