Do you know why I get this error when I try to upload? ...curl: no URL specified! curl: try 'curl --help' or 'curl --manual' for more information Done!
thanks pal for making this freely available Also if u upload to prem acc, it may take a few mins to show up in File Manager.
Hey thanks for this, I am really looking forward to using it... One big problem is that i am a complete noob to scripting, that being said please help cause i am getting confused and kinda frustrated -_-# I am assuming that I would copy and paste it to something like skite or gedit, but what would i save it as, mgupldscript._?? I typed javascript:document.write(document.cookie); into the address bar after i logged into megaupload premium and nothing loaded. I am guesing i did something wrong. Also where would I make the reference for the file/files i want to upload to my account.. Sorry for the dumb questions, any and all help would be appreciated. Thanks in advance. Em
I can only do this with php, as bash is very low level. This is only script based for now. When I have time, will make it shell based. <?php /* place your megaupload cookie string here to obtain one, all you need to do is login to megaupload type the following in address bar javascript:document.write(document.cookie); your string is user=(something); */ $muser = 'MY_COOKIE_STRING'; // example usage submit_megaupload('/path/to/my/file'); function submit_megaupload($file, $description = 'My Description') { global $muser; $postData = array(); $postData['file'] = '@'.$file; $postData['message'] = $description; $postData['password'] = ""; $postData['trafficurl'] = ""; $postData['toemail'] = ""; $postData['fromemail'] = ""; $postData['multiemail'] = ""; $postData['password'] = ""; $postData['user'] = $muser; $postData['hotlink'] = ""; // I could have broken it up here, but I like to do everything on one line. return between("http://www.megaupload.com/?d=", "'", httpSend(between('flashvars.server = "', '";', httpSend("http://www.megaupload.com/", FALSE, "user={$muser}")).'upload_done.php?UPLOAD_IDENTIFIER='.generateRandomID(32).'&user='.$muser.'&s='.filesize($file), TRUE, "user={$muser}", FALSE, $postData)); } // generic curl operations function httpSend($url, $isPOST = false, $cookie = false, $isFollow = FALSE, $postData = array(), $timeout = FALSE) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0"); if (!$cookie) { curl_setopt($ch, CURLOPT_COOKIEFILE, "c.txt"); curl_setopt($ch, CURLOPT_COOKIEJAR, "c.txt"); } else { curl_setopt($ch, CURLOPT_COOKIE, $cookie); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); if ($isFollow) { curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); } if ($isPOST) { curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); } if ($timeout) { curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, CURLOPT_TIMEOUT, 10); } $data = curl_exec($ch); curl_close($ch); return $data; } $nums = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 0); // Converted from disassembled flash http://wwwstatic.megaupload.com/flash/ru.swf function generateRandomID($m) { global $nums; $id = '1'.millitime(); $diff = $m - strlen($id); for ($test = 1; $test <= $diff; ++$test) { $id .= $nums[mt_rand(0, 9)]; } return $id; } // This custom function replaces regex function between($start, $end, $source) { $s = strpos($source, $start) + strlen($start); return substr($source, $s, strpos($source, $end, $s) - $s); } // Php does not have native support for milliseconds function millitime() { return round(microtime(TRUE) * 1000); } ?> PHP:
how can i use the script in shell is it adding #!/usr/bin/php (by googling) but it doesn't seems to work for me, missing php interpreter apparently i have try apt-get install php5 Code (markup): any other package needed? Thank you for your effort really appreciate it
Do you think you'll be able to get it working through shell again? I've been using it for a few weeks and it was great The php s cript doesn't seem to be working with spaces in the filename
I will try to get it working on bash, also trying to figure out a way to get hash checking working. When you upload a file already on megaupload server, it finishes instantly.
Oh wow, hash checking would be great yep >.< Anyway, thanks for the php s cript , gotten it working the way i want it for now
some small change in the src on line 10 submit_megaupload($argv[1]); //submit_megaupload('/path/to/my/file'); PHP: probably you have to make some loops to read more than one parameter call like php -f <script> <path to file> works fine for me at ubuntu 10.10
i very lazy in waiting.. many good file on megaupload.. but i think feature not good with bandwidth limitation
i just discovered that the shell script still usable if you change the url to http://multifetch.megaupload.com/ Code (markup):