command-line rapidshare upload

If you want to upload something to rapidshare.com, quickly, and you only have command-line access, what do you do? This script was promising, but failed on line 30 because a regular expression didn’t match on something that turned out to be an empty (NoneType) object.

I replaced this code:
def upload(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("rapidshare.com", 80))

sock.send('GET /cgi-bin/rsapi.cgi?sub=nextuploadserver_v1 HTTP/1.0\r\n\r\n')
uploadserver = re.search('\r\n\r\n(\d+)', sock.recv(1000000000))
uploadserver = uploadserver.group().lstrip()
sock.close()

with this: def upload(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("rapidshare.com", 80))

uls = sock.send('GET /cgi-bin/rsapi.cgi?sub=nextuploadserver_v1 HTTP/1.0\r\n\r\n')
uploadserver = str(uls)
sock.close()

and it worked.

Update: Get it here.

1 Comment on "command-line rapidshare upload"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.