Created
April 19, 2023 06:02
-
-
Save Katzenwerfer/38546ee7ceec2609b2f0f1a0f6d42cd9 to your computer and use it in GitHub Desktop.
Send a request to Litterbox's API using curl.exe
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
function Litterbox-Request { | |
param ( | |
[Parameter( | |
Mandatory, | |
Position = 0, | |
ValueFromPipeline = $true, | |
HelpMessage = "Path to a file or a media URL." | |
)] | |
[ValidateNotNullOrEmpty()] | |
[string] | |
[System.IO.FileInfo]$InputFile, | |
[parameter( | |
Position = 1, | |
HelpMessage = "Type of request to be sent towards the API." | |
)] | |
[ValidateSet( | |
"fileupload" | |
)] | |
[string] | |
$RequestType = "fileupload", | |
[parameter( | |
Position = 2, | |
HelpMessage = "The time you want the file to be hosted before deletion." | |
)] | |
[ValidateSet( | |
"1h", | |
"12h", | |
"24h", | |
"72h" | |
)] | |
[string] | |
$HostingTime | |
) | |
curl.exe -F "reqtype=$RequestType" -F "time=$HostingTime" -F "fileToUpload=@$InputFile" https://litterbox.catbox.moe/resources/internals/api.php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment