1

I'm trying to implement the Rapidshare Upload script into my Project but it seems like it is out of date. I always receive the following error in Terminal:

File /home/googles/Downloads/weave_minimal.tgz has 10953 bytes. Calculating MD5HEX...
MD5HEX is 12c7dfef24eb0bb249a1f4723cd8daf6 (10953 bytes analyzed)
Trying to upload to your prem account.
Getting upload server infos.
Uploadserver invalid? Internal error!

Here is the script: http://pastebin.com/wSPWa84B

I'm happy for any help, got to get it working soon :)

jordanm
  • 33,009
  • 7
  • 61
  • 76
Googles
  • 257
  • 2
  • 7
  • 11
  • You should always provide the smallest piece of code possible that reproduces the error you are experiencing. – jordanm May 12 '12 at 21:08

1 Answers1

0

I found two problems: 1. the url should be http://rapidshare.com/cgi-bin/rsapi.cgi?sub=nextuploadserver and you have to use HTTP/1.1 to connect to a RS server. So every line you use to connect to RS should look like this:

print $socket qq|GET /cgi-bin/rsapi.cgi?sub=nextuploadserver HTTP/1.1\r\nHost: rapidshare.com\r\n\r\n|

For more information on HTTP/1.1 see rfc2616

I hope this helps!

jobnz
  • 398
  • 3
  • 10
  • Thanks for the help I really appreciate it but I'm encountering another error, which I cant handle =/, Maybe you can help me out again ;) – Googles May 12 '12 at 23:03
  • File /home/googles/Documents/Shared/RapidUpload-1.0/Rapidupload has 1253 bytes. Calculating MD5HEX... MD5HEX is 1b8485f0105d07234517d28675ea38d0 (1253 bytes analyzed) Trying to upload to your prem account. Getting upload server infos. Uploading to rs384l3.rapidshare.com Upload chunk is 1253 bytes starting at 0. Sending 1253 bytes. Server response: ERROR: Your browser is not transmitting the HTTP 'Host' header field. Please use a different browser. Server result did not contain a file ID. – Googles May 12 '12 at 23:04
  • thats what i meant by "every line you use to connect to RS should look like this `print $socket qq|GET UriToRsSite HTTP/1.1\r\nHost: rapidshare.com\r\n\r\n|`". UriToRsSite being the rsapi-call you are trying to make (like /cgi-bin/rsapi.cgi?sub=nextuploadserver) at any point in your script. I think that should do it. --- edit: the problem is that th RS server requires you to use HTTP/1.1 and any HTTP/1.1 request MUST include a Host header field. – jobnz May 12 '12 at 23:08