Advertisement
Th3-822

[rapidleech][u] multiup.org.php

Jan 25th, 2013
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.48 KB | None | 0 0
  1. <?php
  2. ######## Account Info ########
  3. $upload_acc['multiup_org']['user'] = ''; //Set your login
  4. $upload_acc['multiup_org']['pass'] = ''; //Set your password
  5. #######################
  6.  
  7. $DontUlTo = array();
  8. #Plugin Settings#
  9.     # Uncheck/Disable Upload Sites: (Note: It'll upload to sites non listed here if checked at login page).
  10.  
  11.         $DontUlTo['sitename.tld'] = true; // This will uncheck by default the checkbox for upload to 'sitename.tld' at login form and it won't upload to that host at auul.
  12.  
  13.     # MultiUP have added a new site and you want to uncheck/disable it from uploading?: Copy the name showed in Upload to these hosts* and add it in a new line (Lowercase name).
  14. ###########
  15.  
  16. // Don't edit from here unless you know what are you doing.
  17. $not_done = true;
  18. $domain = 'www.multiup.org';
  19. $referer = "http://$domain/";
  20.  
  21. $page = geturl($domain, 80, '/api/get-list-hosts', $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
  22. $page = Get_Reply($page);
  23. if (empty($page['hosts'])) {
  24.     if (empty($page['error']) || strtolower($page['error']) == 'success') html_error('Failed to get hosts list.');
  25.     html_error('Failed to get hosts list: ' . htmlentities($page['error']) . '.');
  26. }
  27. $sites = array_combine(array_map('strtolower', array_keys($page['hosts'])), array_values($page['hosts']));
  28. unset($page);
  29.  
  30. if (!empty($upload_acc['multiup_org']['user']) && !empty($upload_acc['multiup_org']['pass'])) {
  31.     $default_acc = true;
  32.     $_REQUEST['up_login'] = $upload_acc['multiup_org']['user'];
  33.     $_REQUEST['up_pass'] = $upload_acc['multiup_org']['pass'];
  34.     $_REQUEST['action'] = 'FORM';
  35.     echo "<b><center>Using Default Login.</center></b>\n";
  36. } else $default_acc = false;
  37.  
  38. if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
  39.     echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
  40.     <form method='POST'>
  41.     <input type='hidden' name='action' value='FORM' />
  42.     <tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
  43.     <tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
  44.     echo "\t<tr><td colspan='2' align='center'><br />Upload to these hosts*<br /><br /></td></tr>\n";
  45.     foreach ($sites as $site => $data) echo "\t<tr><td style='white-space:nowrap;' align='left'><input type='checkbox' name='UpT8[" . htmlentities($site, ENT_QUOTES) . "]' value='1'" . (($fsize > ($data['size'] * 1048576)) ? " title='This file is too heavy for the max size allowed for this hoster.'" : (!empty($DontUlTo[$site]) ? " title='Unchecked by default for \$DontUlTo setting.'" : " checked='checked'")) . " /></td><td style='white-space:nowrap;' align='right'>&nbsp;".htmlentities($site)."&nbsp; ({$data['size']} MB)</td>\n";
  46.     echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' onclick='javascript:return checkh();' /></td></tr>\n";
  47.     echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>" . basename(__FILE__) . "</b></small></td></tr>\n";
  48.     echo "</form>\n</table>\n";
  49.     echo "<script type='text/javascript'>/*<![CDATA[*/\nself.resizeTo(700,600);function checkh() {if ($(':checkbox').filter(':checked').length < 1) {alert('You mush select at least one filehoster for upload.'); return false;} return true;\n}\n/*]]>*/</script>\n"; //Resize upload window && Form Check
  50. } else {
  51.     $login = $not_done = false;
  52.  
  53.     // Login
  54.     echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";
  55.  
  56.     $cookie = array('user_lang' => 'en');
  57.     if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
  58.         $post = array('username' => urlencode($_REQUEST['up_login']), 'password' => urlencode($_REQUEST['up_pass']));
  59.  
  60.         $page = geturl($domain, 80, '/api/login', $referer, 0, $post, 0, $_GET['proxy'], $pauth);is_page($page);
  61.         $json = Get_Reply($page);
  62.         if (empty($json['user'])) {
  63.             if (empty($json['error']) || strtolower($json['error']) == 'success') html_error('Login error: UserID value not found.');
  64.             html_error('Login error: ' . htmlentities($json['error']) . '.');
  65.         }
  66.         $user = $json['user'];
  67.  
  68.         $login = true;
  69.     } else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
  70.  
  71.     // Retrive upload ID
  72.     echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
  73.  
  74.     $page = geturl($domain, 80, '/api/get-fastest-server', $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
  75.     $json = Get_Reply($page);
  76.     if (empty($json['server'])) {
  77.         if (empty($json['error']) || strtolower($json['error']) == 'success') html_error('Cannot get upload url.');
  78.         html_error('Cannot get upload url: ' . htmlentities($json['error']) . '.');
  79.     }
  80.  
  81.     $post = array();
  82.     if ($login) $post['user'] = $user;
  83.     $i = 1;
  84.     foreach (array_keys($sites) as $site) if ((!empty($_POST['UpT8']) && !empty($_POST['UpT8'][$site])) || (empty($_POST['UpT8']) && empty($DontUlTo[$site]))) $post['host' . $i++] = $site;
  85.  
  86.     $up_url = $json['server'];
  87.  
  88.     // Uploading
  89.     echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
  90.  
  91.     $url = parse_url($up_url);
  92.     $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, 0, $post, $lfile, $lname, 'files[]', '', $_GET['proxy'], $pauth, 0, $url['scheme']);
  93.  
  94.     // Upload Finished
  95.     echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
  96.  
  97.     is_page($upfiles);
  98.  
  99.     $json = Get_Reply($upfiles);
  100.     if (empty($json['url'])) {
  101.         if (empty($json['error']) || strtolower($json['error']) == 'success') html_error('Upload error.');
  102.         html_error('Upload error: ' . htmlentities($json['error']) . '.');
  103.     }
  104.  
  105.     $download_link = $json['url'];
  106. }
  107.  
  108. function Get_Reply($page) {
  109.     if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
  110.     $body = substr($page, strpos($page, "\r\n\r\n") + 4);
  111.     if (empty($body)) html_error('Error reading json (Empty page).');
  112.     $body = substr($body, strpos($body, '{'));$body = substr($body, 0, strrpos($body, '}') + 1);
  113.     $json = json_decode($body, true);
  114.     if (empty($json)) html_error('Error reading json.');
  115.     return $json;
  116. }
  117.  
  118. //[25-1-2013] Written by Th3-822.
  119. //[14-12-2015] Fixed. - Th3-822
  120. //[19-7-2016] Added referer to requests to fix small bug. - Th3-822
  121.  
  122. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement