Skip to content

Instantly share code, notes, and snippets.

@vt-idiot
Created February 14, 2023 00:45
Show Gist options
  • Save vt-idiot/8a7161a48dc6f7f7719423e938217267 to your computer and use it in GitHub Desktop.
Save vt-idiot/8a7161a48dc6f7f7719423e938217267 to your computer and use it in GitHub Desktop.
Catbox Script for s0hv/foo_discord_rich
<#usage: use the following line as your command in the foobar2000 plugin
pwsh.exe C:\Path\To\catbox.ps1
note: doesn't work right on PowerShell 5 "powershell.exe", you need PowerShell 7#>
$upload = Resolve-Path -LiteralPath $input | Select-Object -ExpandProperty Path
$uri = "https://catbox.moe/user/api.php"
$body = @{
"reqtype"="fileupload"
"fileToUpload"=Get-Item $upload
}
Invoke-WebRequest -Uri $uri -Method POST -Form $body | Select-Object -ExpandProperty Content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment