Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] Przerobienie skryptu
Forum PHP.pl > Inne > Giełda ofert > Poszukuję
miki3475
Witam, kiedyś posiadałem skrypt Megaupload.com Premium Link Generator, gdzie wpisywaliśmy w kodzie własne konto premium, a następnie po wpisaniu linków na stronie wyświetlały się nam bezpośrednie odnośniki tak jakbyśmy weszli na konto premium i kliknęli 'Kopiuj adres odnośnika'. Za przerobienie skryptu płacę 10-15zł lub konto Premium na co najmniej 90 dni.

Oto kod:
  1. <?php
  2.  
  3.  
  4. header('Content-Type: text/html; charset=utf-8');
  5. header('Cache-Control: no-cache, must-revalidate, proxy-revalidate');
  6. header('Expires: '. gmdate("D, d M Y H:i:s", time()) . ' GMT');
  7.  
  8. // better disable error reporting altogether in production
  9.  
  10. /**
  11.  * The premium account hash (so no username/password is actually revealed)
  12.  *
  13.  *  How to get:
  14.  *
  15.  *  1. Using a premium account, logon to megaupload
  16.  *  2. When logged-in, view your cookies for the domain 'megaupload.com'
  17.  *
  18.  *     - or -
  19.  *
  20.  *     While still in any MU page, type this onto your browser's address bar:
  21.  *
  22.  *     java script:alert(document.cookie)
  23.  *
  24.  *     The 32-character string will be the account hash ;-)
  25.  *
  26.  *     e.g. 5f393381926eb922d4e2a91fb3d9bf6c
  27. */
  28.  
  29. $user   = '5f393381926eb922d4e2a91fb3d9bf6c';
  30. $result = ''; // will hold either the premium link or some error on return
  31.  
  32. if ($_SERVER['REQUEST_METHOD'] == 'POST')
  33. {
  34.  srand((float) microtime() * 10000000);
  35.  
  36.  $uas = array(
  37.    'Firefox/2.0.0.5',
  38.    'Firefox/2.0.0.6',
  39.    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)',
  40.    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)',
  41.    'Opera/9.21 (Windows NT 5.1; U; en)',
  42.    'Opera/9.22 (Windows NT 5.1; U; en)'
  43.  );
  44.  
  45.  // pick a random user-agent
  46.  $ua_k = array_rand($uas);
  47.  $ua = $uas[$ua_k];
  48.  
  49.  $link = trim($_POST['link']);
  50.  
  51.  $links = explode("\n", $link);
  52.  $ile = count($links);
  53.  $ile--;
  54.  
  55.  for ($i = 0; $i <= $ile; $i++) {
  56.      $links[$i] = trim($links[$i]);
  57.      //echo $i  . " " . $links[$i] . "<br />";
  58.  }
  59.  
  60.  for ($i = 0; $i <= $ile; $i++) {
  61.  $link = $links[$i];
  62.  // verify link in the format: http://www.megaupload.com/?d=XXXXXXXX
  63.  if ( !preg_match("|http://(w+.)?megaupload.com/?d=[[:alnum:]]{8}|Ui", $link, $matches ) )
  64.  {
  65.    $result = "Invalid MU link.";
  66.  }
  67.  else
  68.  {
  69.    $purl = parse_url($link);
  70.    extract($purl);
  71.  
  72.    // make our actual request (extra headers to emulate a web browser)
  73.    $h  = '';
  74.    $h .= "GET /?$query HTTP/1.0r\n";
  75.    $h .= "User-Agent: $uar\n";
  76.    $h .= "Host: $hostr\n";
  77.    $h .= "Referer: http://$host/r\n";
  78.    $h .= "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1r\n";
  79.    $h .= "Accept-Language: en-US,en;q=0.9r\n";
  80.    $h .= "Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1r\n";
  81.    $h .= "Cookie: user=$userr\n";
  82.    $h .= "Cookie2: $Version=1r\n";
  83.    $h .= "Connection: Keep-Aliver\n";
  84.    $h .= "Pragma: no-cacher\n";
  85.    $h .= "Cache-Control: no-cacher\nr\n";
  86.  
  87.    // try to connect to $host
  88.    if ( !$fp = fsockopen($host, 80, $errno, $errstr, 30) )
  89.    {
  90.      // whups, failed :-(
  91.      $result = "I couldn't connect to $host!";
  92.    }
  93.    else
  94.    {
  95.      // pass the request
  96.      fputs($fp, $h);
  97.      $response = '';
  98.  
  99.      // fetch result
  100.      while ( !feof($fp) )
  101.      {
  102.        $response .= fread($fp, 1024);
  103.      }
  104.  
  105.      // cleanup
  106.      fclose($fp);
  107.  
  108.      // works as of 20070907:
  109.      preg_match("|String.fromCharCode(Math.abs(([^)]+)));|i", $response, $abs);
  110.      preg_match("|'(.)'s+sString.fromCharCode(Math.sqrt(([^)]+)));|i", $response, $sqrt);
  111.      preg_match("|<a href=\"([^\"]+)' + ([a-z]) + ([a-z]) + '([^\"]+)\" class=\"downloadhtml\"|i", $response, $link);
  112.  
  113.      // and bam, our link :-)
  114.      $result = $link[1] . $sqrt[1] . chr(sqrt($sqrt[2])) . chr(abs($abs[1])) .$link[4];
  115.    }
  116.  }
  117.  $link_prem[$i] = $result;
  118. }
  119. }
  120. ?>
  121. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  122.  
  123. <html xmlns="http://www.w3.org/1999/xhtml" lang="en-ph" xml:lang="en-ph">
  124. <head>
  125.  <title>Megaupload Multiple Premium Link Generator</title>
  126.  <meta http-equiv="Content-Type" content="text/html; utf-8" />
  127.  <meta name="copyright" content="reeky" />
  128. <style type="text/css">
  129. /*<![CDATA[*/
  130.  body,input{font: small Verdana, Geneva, Arial, Helvetica, sans-serif;}
  131.  a{color:#00C;}
  132.  h2{margin-bottom:0;}
  133. /*]]>*/
  134. </style>
  135. </head>
  136.  
  137. <body>
  138.  <h2>Megaupload Multiple Premium Link Generator</h2>
  139.  
  140.  <form name="a" action="" method="post" id="a">
  141.    Megaupload Link: (e.g. http://www.megaupload.com/?d=XXXXXXXX)<br />
  142. You can paste unlimited links!
  143.    <br />
  144.    <textarea name="link" cols="60" rows="20"><?php print !empty($_POST['link']) ? $_POST['link'] : ''; ?></textarea><br>
  145.    <input type="hidden" name="wyslany" />
  146.    <input type="submit" value="Go!" />
  147.  </form>
  148.  
  149.  <div id="premium_link">
  150.  <?php
  151.  if (isset($_POST['wyslany'])) {
  152.    for ($i = 0; $i <= $ile; $i++) {
  153.        echo $link_prem[$i] . "<br />\n";
  154.    }
  155.  }
  156.  ?>
  157.  </div>
  158. </body>
  159. </html>


Kontakt:

GG: 5675055
miki3475[at]gmail.com
pyro
Przerobić na co?
Speedy
Haha, Przerobienie skryptu za 2 piwa winksmiley.jpg. Kolego, czegokolwiek byś nie zlecił, taka oferta wygląda niepoważnie. Przepraszam, ale nie mogłem się powstrzymać tongue.gif.

// No to się pilnuj, bo któryś raz z kolei masz problem z trzymaniem języka za zębami.
// ~webdice
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.