luzif3r Posted April 16, 2008 Share Posted April 16, 2008 well a long time ago rapidshare released two wonderful perl scripts to upload files and i'd like to ask if anyone here might have enough knowledge of perl to convert them to autoit(if even possible). since i lack experience with perl i don't understand everything in the code.here the two scripts:http://images.rapidshare.com/software/rsapi.plthis one has less comments but you can resume your upload:http://images.rapidshare.com/software/rsapiresume.plso far i can connect to the specified site and use GET to retrieve some data, but i guess the HTTP.au3 lacks something, because there is some information missing, mainly the uploadserver i can upload to.i could see the serveradress clearly using "live http headers" in firefox but i lack the knowledge to modify the HTTP.au3 properly.Any help or suggestions are appreciated.p.s. its not about downloading or bypassing anything Link to comment Share on other sites More sharing options...
luzif3r Posted April 16, 2008 Author Share Posted April 16, 2008 well well consider this a little bump what i got so far(ain't much): #include <HTTP.au3> #include <Array.au3> $socket1 = _HTTPConnect("www.rapidshare.com") _HTTPGet("www.rapidshare.com", "/cgi-bin/rsapi.cgi?sub=nextuploadserver_v1", $socket1) $data = _HTTPRead($socket1, 1) If @error Then MsgBox(0, "", @error) EndIf _ArrayDisplay($data) gives us: [0]|200 [1]|OK [2]|1.1 [3]| [4]|272 but we need the header information(atleast i think so). quick change: _ArrayDisplay($data[3]) depending on your browser and whatnot you get different shit back, like: [0]|P3P|CP="ALL DSP COR CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa CONa TELa OUR STP UNI NAV STA PRE" [1]|Date|Wed, 16 Apr 2008 23:05:28 GMT [2]|Connection|close [3]|Accept-Ranges|bytes [4]|Content-Type|text/html; charset=ISO-8859-1 [5]|Cache-Control|no-cache [6]|Content-Length|2 firefox with "live http headers" gives us something like this: http://rs27l3.rapidshare.com/cgi-bin/uploadjs.cgi?uploadid=146769884569580387&r=0 GET /cgi-bin/uploadjs.cgi?uploadid=146769884569580387&r=0 HTTP/1.1 Host: rs27l3.rapidshare.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-gb,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://rs27l3.rapidshare.com/progress.html?uploadid=146769884569580387 Cookie: user=c2790876-%6D%6E%62%76%63%78%79 HTTP/1.x 200 OK P3P: CP="ALL DSP COR CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa CONa TELa OUR STP UNI NAV STA PRE" Date: Wed, 16 Apr 2008 23:11:43 GMT Connection: close Accept-Ranges: bytes Content-Type: text/html; charset=ISO-8859-1 Cache-Control: no-cache Content-Length: 4 well its not the same and we miss quite a bit of information necessary to us: -the host(?) -uploadid(?) -some variable here the relevant perl script part: $socket = IO::Socket::INET->new(PeerAddr => "rapidshare.com:80") || die "Unable to open port: $!\n"; having a socket connected to rapidshare.com on port 80 thats doable print $socket qq|GET /cgi-bin/rsapi.cgi?sub=nextuploadserver_v1 HTTP/1.0\r\n\r\n|; here it sends the get and does some formatting or something. i dunno. but combined with ($uploadserver) = <$socket> =~ /\r\n\r\n(\d+)/; which is some more formatting the uploadserver magically appears and its even printed print "Uploading to rs$uploadserver$uploadpath.rapidshare.com\n"; showing: Uploading to rs289l3.rapidshare.com after getting the correct upload path the socket is opened and the file. A header gets constructed with the acc, pw and whatnot and gets send with POST. Sorry for the big post. I know its not actually useful information but i still hope someone might just be good with headers and maybe someone with perl and there we go Link to comment Share on other sites More sharing options...
Vindicator209 Posted April 17, 2008 Share Posted April 17, 2008 personally, I wouldn't bother with that long script, and completely rewrite your OWN , either by using the information you might salvage from that script, or macroing the upload sequence, and hiding the window(thus background work) [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
luzif3r Posted April 17, 2008 Author Share Posted April 17, 2008 finally a reply yay heh i can macro the sequence with a hidden ie window ofc. the problem is not writing the script its as you put it salvaging the information. i still need the dynamically chosen uploadserver and the pattern which is used to to get it and the headers etc. i can write the connecting and sending on my own only thing is the data that i need to send. thanks anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now