Rapidshare API with PowerShell

后端 未结 2 1794
故里飘歌
故里飘歌 2021-01-27 16:39
$FreeUploadServer = Invoke-RestMethod -Uri \"http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=nextuploadserver\"
Invoke-RestMethod -Uri \"http://rs$FreeUploadServer.rapid         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-27 17:22

    Turns out there is a tiny section in the API Documentation that says if you use the POST method all parameters need to be passed in the body. I wrote a function that uploads to RapidShare in PowerShell, i hope this helps people in the future cause this was VERY annoying.

    function Upload-RapidShare([string]$File,[string]$Name)
    {
         $FreeUploadServer = Invoke-RestMethod -Uri "http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=nextuploadserver"
         Invoke-RestMethod "http://rs$FreeUploadServer.rapidshare.com/cgi-bin/rsapi.cgi" -Body  "sub=upload&login=USERNAME&password=PASSWORD&filename=$Name&filecontent=$File" -Method Post
    }
    

提交回复
热议问题