Share Pastebin
Guest
Public paste!

Anonymo / /rs/ install for KusabaX

By: a guest | Aug 23rd, 2010 | Syntax: PHP | Size: 6.31 KB | Hits: 71 | Expires: Never
Copy text to clipboard
  1. <title>/rs/ Setup</title>
  2. Note: With this install script you can only ADD sites <br />
  3. to delete them you have to go directly in the database <br />
  4. <br />
  5. <?php
  6. $sites = array(
  7.         "RapidShare" => "'RapidShare',
  8.                                         '#http://[^(\\\\s<)]*rapidshare.com/files/\\\\d+/[^(\\\\s<)]*#',
  9.                                         '#http://[^(\\\\s<)]*rapidshare.com/files/\\\\d+/([^(\\\\s<)]*)#',
  10.                                         '#\\\\| (\\\\d+ KB)#',
  11.                                         'rs'",
  12.         "MegaUpload" => "'MegaUpload',
  13.                                         '#http://www.megaupload.com/\\\\?d=[^(\\\\s<)]*#',
  14.                                         '#Filename:.*\">([^<]*)#',
  15.                                         '#File size:.*\">([^<]*)#',
  16.                                         'mu'",
  17.         "MiniNova" =>   "'MiniNova',
  18.                                         '#http://www.mininova.org/tor/\\\\d+#',
  19.                                         '#<h1>([^<]*)#',
  20.                                         '#<strong>Total size:</strong>\\\\n([^<]*)#',
  21.                                         'mn'",
  22.         "MediaFire" =>  "'MediaFire',
  23.                                         '#http://www.mediafire.com/\\\\?\\\\w+#',
  24.                                         '#<title>([^<]*)#',
  25.                                         '#<input type=\"hidden\" id=\"sharedtabsfileinfo1-fs\" value=\"([^\\\\\"]*)#',
  26.                                         'mf'",
  27.         "SendSpace" =>  "'SendSpace',
  28.                                         '#http://www.sendspace.com/file/\\\\w+#',
  29.                                         '#<b>Name:</b>([^\\\\t]*)#',
  30.                                         '#<b>Size:</b>([^\\\\t]*)#',
  31.                                         'ss'",
  32.         "VerTor" =>             "'VerTor',
  33.                                         '#http://www.vertor.com/torrents/\\\\d+/[^(\\\\s<)]*#',
  34.                                         '#<h1>([^<]*)#',
  35.                                         '#size</th>[\\\\s\\\\S]*?g>([^<]*)#',
  36.                                         'vt'",
  37.         "BTJunkie" =>   "'BTJunkie',
  38.                                         '#http://btjunkie.org/torrent/[^(\\\\s<)]*#',
  39.                                         '#<title>([^<]*) Torrent -#',
  40.                                         '#Size</th>[\\\\s\\\\S]*? #000000;border-right: 1px solid #000000;\">([^<]*)#',
  41.                                         'bj'",
  42.         "MoNova" =>     "'MoNova',
  43.                                         '#http://www.monova.org/details/\\\\d+/[^(\\\\s<)]*#',
  44.                                         '#<title>DOWNLOAD : ([^<]*) Torrent#',
  45.                                         '#Total size:</strong>([^<]*)#',
  46.                                         'mo'",
  47.         "SeedPeer" =>   "'SeedPeer',
  48.                                         '#http://www.seedpeer.com/details/\\\\d+.html#',
  49.                                         '#<title>([^<]*) Torrent#',
  50.                                         '#Size</td><td>([^<]*)#',
  51.                                         'sp'",
  52.         "H33T" =>               "'H33T',
  53.                                         '#http://www.h33t.com/details.php\\\\?id=[^(\\\\s<)]*#',
  54.                                         '#<title>h33t - ([^<]*) - #',
  55.                                         '#Size:</td><td class=\"lista\" >([^<]*)#',
  56.                                         'h3'",
  57.         "ZShare" =>     "'ZShare',
  58.                                         '#http://www.zshare.net/download/[^(\\\\s<)]*/#',
  59.                                         '#<title>zSHARE - ([^<]*)#',
  60.                                         '/File Size: <font color=\"#666666\">([^<]*)/',
  61.                                         'zs'",
  62.         "NakedMoses" => "'NakedMoses',
  63.                                         '#http://[^(\\\\s<)]*nakedmoses.com/torrents-details.php\\\\?id=\\\\d+#',
  64.                                         '#<title>.*&quot;(.*)&quot;#',
  65.                                         '#Total Size:</b></td><td>([^<]*)#',
  66.                                         'nm'",
  67.         "IsoHunt" =>    "'IsoHunt',
  68.                                         '#http://isohunt.com/torrent_details/\\\\d+/\\\\?tab=summary#',
  69.                                         '#<title>([^\\\\|]*)#', '#<p><i><b>([^<]*)#',
  70.                                         'ih'",
  71.         "HotFile" =>    "'HotFile',
  72.                                         '#http://hotfile.com/dl/[^\\\\s<]*#',
  73.                                         '#<title>.*: ([^<]*)#',
  74.                                         '#<div class=\"arrow_down\"><strong>.*<strong>([^<]*)</strong>#',
  75.                                         'hf'",
  76.         "MultiUpload"=> "'MultiUpload',
  77.                                         '#http://www.multiupload.com/[^\\\\s<]*#',
  78.                                         '/font-size:19px; color:#000000;\">([^<]*)/',
  79.                                         '/<font style=\"color:#666666;\">([^<]*)/',
  80.                                         'muu'",
  81.         /*"iFile" =>            "'iFile',
  82.                                         '#http://ifile.it/[^\\\\s<]*#',
  83.                                         '#\\\\t\\\\t([^\\\\t]*)\\\\t\&nbsp;$#',
  84.                                         '#\\\\t\\\\t(\\\\d+\\\\.\\\\d+[^\\\\t]*)#',
  85.                                         'if'",*/
  86.         "DepositFiles"=>"'DepositFiles',
  87.                                         '#http://depositfiles.com/files/[^\\\\s<]*#',
  88.                                         '#File name:[^>]*>([^<]*)#',
  89.                                         '#File size:[^>]*>([^<]*)#',
  90.                                         'df'",
  91.         "Uploading" =>  "'Uploading',
  92.                                         '#http://uploading.com/files/[^(\\\\s<)]*#',
  93.                                         '#\\\\t\\\\t\\\\t\\\\t<h2>([^<]*)</h2><br/>#',
  94.                                         '#File size:[^>]*>([^<]*)#',
  95.                                         'up'",
  96.         "Demonoid" =>   "'Demonoid',
  97.                                         '#http://www.demonoid.com/files/details/\\\\d+/\\\\d+/#',
  98.                                         '#<title>([^<]*) - Demonoid#',
  99.                                         '#Size:</b> ([^<]*)#',
  100.                                         'dm'"/*,
  101.         "ThePirateBay"=>"'ThePirateBay',
  102.                                         '##',
  103.                                         '##',
  104.                                         '##',
  105.                                         'pb'"*/
  106. )
  107. ?>
  108.  
  109.  
  110. <form action="" method="post">
  111.         <input type="checkbox" name="install" />This is my first install<br />
  112. <?php
  113. require ('config.php');
  114.  
  115. $output = '';
  116. foreach (array_keys($sites) as $site) {
  117.         $active = $tc_db->GetAll("SELECT `name` FROM `".KU_DBPREFIX."rs_sites` WHERE `name` = '".$site."'");
  118.         if (count($active) > 0)
  119.                 $checked = 'checked';
  120.         else
  121.                 $checked = '';
  122.                
  123.         $output .= '<input type="checkbox" name="'.$site.'" '.$checked.'>'.$site.'<br />';
  124. }
  125. echo $output;
  126. ?>
  127. <br />
  128. <br />
  129. Fill this field if and only if you know what you are doing:<br />
  130. <span style="color: #f00; font-weight: bold">Warning: This might fuck up your database, so pay attention.</span><br />
  131. Insert new site here: <input type="text" size="64" name="newsite" />
  132. <br />
  133. <br />
  134. <input type="submit" value="Install!">
  135.  
  136.  
  137. </form>
  138.  
  139. <?php
  140. if (isset($_POST['install'])) {
  141.         echo "<b>Creating the rs_sites table... </b><br>";
  142.                 $tc_db->Execute("CREATE TABLE `".KU_DBPREFIX."rs_sites` (
  143.                         `id` INT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  144.                         `name` VARCHAR( 255 ) NOT NULL ,
  145.                         `regex` VARCHAR( 255 ) NOT NULL ,
  146.                         `name_regex` VARCHAR( 255 ) NOT NULL ,
  147.                         `size_regex` VARCHAR( 255 ) NOT NULL ,
  148.                         `abbreviation` VARCHAR( 16 ) NOT NULL
  149.                         ) ENGINE = MYISAM DEFAULT CHARSET=utf8;");
  150.         echo "Done.<br>";
  151.         echo "<b>Creating the rs_links table... </b><br>";
  152.                 $tc_db->Execute("CREATE TABLE `".KU_DBPREFIX."rs_links` (
  153.                         `id` INT( 32 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  154.                         `link` VARCHAR( 255 ) NOT NULL ,
  155.                         `name` VARCHAR( 64 ) NOT NULL ,
  156.                         `size` VARCHAR( 64 ) NOT NULL ,
  157.                         `board` VARCHAR( 64 ) NOT NULL ,
  158.                         `site` VARCHAR( 64 ) NOT NULL ,
  159.                         `password` VARCHAR( 64 ) NOT NULL ,
  160.                         `date` VARCHAR( 32 ) NOT NULL
  161.                         ) ENGINE = MYISAM DEFAULT CHARSET=utf8;");
  162.         echo "Done.<br><br>";
  163. }
  164.  
  165. unset($_POST['install']);
  166.  
  167.  
  168.  
  169. if ($_POST['newsite'] != '') {
  170.         echo "<b>Adding in rs_sites the new link... </b><br>";
  171.         $query = "REPLACE INTO `".KU_DBPREFIX."rs_sites` (`name`, `regex`, `name_regex`, `size_regex`, `abbreviation`) VALUES (". stripslashes($_POST['newsite']) . ")";
  172.         $tc_db->Execute($query);
  173.         echo "Done.<br><br>";
  174.         unset ($_POST['newsite']);
  175. } elseif (count(array_keys($_POST)) > 0) {
  176.         $installsites = array_keys($_POST);
  177.         echo "<b>Filling in rs_sites table... </b><br>";
  178.         foreach ($installsites as $installsite) {
  179.                 $exists = $tc_db->GetOne("SELECT id FROM `".KU_DBPREFIX."rs_sites` WHERE `name` = '".$installsite."'");
  180.                 if($exists != '') {
  181.                         $query = "REPLACE INTO `".KU_DBPREFIX."rs_sites` (`name`, `regex`, `name_regex`, `size_regex`, `abbreviation`) VALUES (". $sites[$installsite] . ")";
  182.                         $tc_db->Execute($query);
  183.                 }
  184.         }
  185.         echo "Done.<br><br>";
  186. }
  187. ?>