Skip to content

Commit

Permalink
[FEATURE] Update jquery library to 1.91 also update some deprecated j…
Browse files Browse the repository at this point in the history
…query function in related files

[PLUGIN] Update zippyshare.com, letitbit.net (Th3-822), new hugefiles.net, upafile.com, filezy.net (SD-88), new datafile.com, ex-load.com, upstore.net download plugin also update the hostname in hosts.php
[PLUGIN] New filewinds.com, filezy.net, hugefiles.net (SD-88) upload plugin
  • Loading branch information
ruudvtony committed Apr 29, 2013
1 parent 493cf87 commit 93fa0cf
Show file tree
Hide file tree
Showing 25 changed files with 1,290 additions and 176 deletions.
42 changes: 14 additions & 28 deletions classes/js.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion configs/accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
//$premium_acc ["luckyshare_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["cyberlocker_ch"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["nowvideo_eu"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["upstore_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["ex-load_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["datafile_com"] = array('user' => 'your username', 'pass' => 'your password');

###Premium cookie configuration, dont use this if you have already set another premium account config
//$premium_acc["hotfile_com"] = array('cookie' => 'your premium cookie');
Expand All @@ -71,7 +74,12 @@
//$premium_acc["fileflyer_com"] = array('pass' => 'your password');
//$premium_acc["livefile_org"] = array('key' => 'your password');


###Auto Download Premium Account###
//$premium_acc["au_dl"] = array('user' => 'your username', 'pass' => 'your password'); # Remove '//' from the beginning and enter your username and password for rapidshare.de premium account

#Secret key for cookie encryption
#Make up a random one to protect your premium cookies (max length: 56). Example: 'secretkey' = 'UijSY5wjP1Ii'; - DO NOT use this example 'secretkey', or your premium accounts/cookies could be stolen!!
#IF THIS IS NOT SET BEFORE YOU USE PREMIUM SERVICES, YOU WILL BE WARNED BY THE RAPIDLEECH SCRIPT. OTHERWISE YOUR PREMIUM ACCOUNTS AND/OR COOKIES COULD BE COMPROMISED!
$secretkey = '';

?>
84 changes: 40 additions & 44 deletions configs/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,42 +47,38 @@ function load_current_config() {
elseif (is_file(CONFIG_DIR."config_old.php")) { include(CONFIG_DIR."config_old.php"); $old_options = true; }

foreach ($default_options as $k => $v) { if (!array_key_exists($k, $options)) { $options[$k] = $v; } }

foreach ($options as $k => $v) {
if (!array_key_exists($k, $default_options) || is_array($default_options[$k])) { continue; }
$v = js_special_chars($v);
if (is_bool($default_options[$k])) {
echo " $('#opt_{$k}').".($v ? "attr('checked', 'checked')" : "removeAttr('checked')").";\n";
}
elseif (is_numeric($default_options[$k])) {
$v = floor($v);
echo " set_element_val('opt_{$k}', '".($k == 'delete_delay' ? $v."', '".floor($v/60) : $v)."');\n";
}
else { echo " set_element_val('opt_{$k}', '{$v}');\n"; }
}
?>
$('#opt_forbidden_filetypes').val('<?php
foreach ($options['forbidden_filetypes'] as $k => $v) {
echo js_special_chars($v).(count($options['forbidden_filetypes'])-1 == $k ? '' : ', ');
}
?>');
while ($('#opt_login_table tbody>tr').size() < <?php echo count($options['users']); ?>) { $("#opt_login_add").click(); }
while ($('#opt_login_table tbody>tr').size() > <?php echo max(1, count($options['users'])); ?>) { $('#opt_login_table tbody>tr:last').remove(); }
<?php
$i = 0;
foreach ($options['users'] as $k => $v) {
$k = js_special_chars($k); $v = js_special_chars($v);
echo " $('#opt_login_table [name=users[]]').eq({$i}).val('{$k}');\n";
echo " $('#opt_login_table [name=passwords[]]').eq({$i}).val('{$v}');\n";
$i++;
}
?>
if ($('#opt_forbidden_filetypes_block').attr('checked')) { $('#opt_rename_these_filetypes_to_0').hide(); }
else { $('#opt_rename_these_filetypes_to_0').show(); }
if ($('#opt_login').attr('checked')) { $('#opt_login_0').show(); }
else { $('#opt_login_0').hide(); }
if ($('#opt_new_window').attr('checked')) { $('#opt_new_window_0').show(); }
else { $('#opt_new_window_0').hide(); }
var options = jQuery.parseJSON(<?php echo json_encode(json_encode($options))?>);
var default_options = jQuery.parseJSON(<?php echo json_encode(json_encode($default_options))?>);

$.each(options, function(k, v){
if (jQuery.type(default_options[k]) === 'object') { return; }
if (jQuery.type(default_options[k]) === 'array') {
$('#opt_'+k+'').val(v);
} else if (jQuery.type(default_options[k]) === 'boolean') {
$('#opt_'+k+'').prop('checked', v ? true : false);
} else if (jQuery.type(default_options[k]) === 'number') {
set_element_val('opt_'+ k, k === 'delete_delay' ? (v, Math.floor(v/60)) : v);
} else {
set_element_val('opt_'+ k, v);
}
});
while ($('#opt_login_table tbody>tr').size() < <?php echo count($options['users']); ?>) { $("#opt_login_add").click(); }
while ($('#opt_login_table tbody>tr').size() > <?php echo max(1, count($options['users'])); ?>) { $('#opt_login_table tbody>tr:last').remove(); }

var i = 0;
$.each(options['users'], function(u, p){
$('#opt_login_table [name="users[]"]').eq(i).val(u);
$('#opt_login_table [name="passwords[]"]').eq(i).val(p);
i++;
});

if ($('#opt_forbidden_filetypes_block').prop('checked')) { $('#opt_rename_these_filetypes_to_0').hide(); }
else { $('#opt_rename_these_filetypes_to_0').show(); }
if ($('#opt_login').prop('checked')) { $('#opt_login_0').show(); }
else { $('#opt_login_0').hide(); }
if ($('#opt_new_window').prop('checked')) { $('#opt_new_window_0').show(); }
else { $('#opt_new_window_0').hide(); }
}

function set_element_val(id, value, display) {
Expand All @@ -96,8 +92,8 @@ function save_config() {
}

$(document).ready(function() {
$("#save").removeAttr("disabled");
$("#reset").removeAttr("disabled");
$("#save").prop("disabled", false);
$("#reset").prop("disabled", false);
$('#save').click(function() { save_config(); });
$('#reset').click(function() { load_current_config(); });

Expand All @@ -110,17 +106,17 @@ function save_config() {
$('#div_main_advanced').click();

$('#opt_login_cgi').click(function() {
if ($(this).attr('checked')) { alert('Verify that main .htaccess is writeable before saving the config so the CGI fix can be applied correctly.'); }
if ($(this).prop('checked')) { alert('Verify that main .htaccess is writeable before saving the config so the CGI fix can be applied correctly.'); }
});
$('#opt_disable_actions').click(function() {
if ($(this).attr('checked')) { $('#opt_actions_table :checkbox:not(#opt_disable_deleting)').each(function() { $(this).attr('checked', 'checked'); }); }
else { $('#opt_actions_table :checkbox:not(#opt_disable_deleting)').removeAttr('checked'); }
if ($(this).prop('checked')) { $('#opt_actions_table :checkbox:not(#opt_disable_deleting)').each(function() { $(this).prop('checked', true); }); }
else { $('#opt_actions_table :checkbox:not(#opt_disable_deleting)').prop('checked', false); }
});
$('#opt_disable_deleting').click(function() {
if ($(this).attr('checked')) {
$('#opt_disable_delete').attr('checked', 'checked');
if ($(this).prop('checked')) {
$('#opt_disable_delete').prop('checked', true);
}
else { $('#opt_disable_delete').removeAttr('checked'); }
else { $('#opt_disable_delete').prop('checked', false); }
});
$("#opt_forbidden_filetypes_block").click(function() { $('#opt_rename_these_filetypes_to_0').toggle(); } );
$("#opt_new_window").click(function() { $('#opt_new_window_0').toggle(); } );
Expand Down Expand Up @@ -257,7 +253,7 @@ function array_trim(&$v) { $v = trim($v); }
}
else { echo 'There was a problem with users and passwords<br /><br />'; }

ob_start(); var_export($options); $opt = ob_get_contents(); ob_end_clean();
$opt = var_export($options, true);
$opt = (strpos($opt, "\r\n") === false ? str_replace(array("\r", "\n"), "\r\n", $opt) : $opt);
$opt = "<?php\r\n if (!defined('RAPIDLEECH')) { require_once('index.html'); exit; }\r\n\r\n\$options = ".
$opt.
Expand Down
153 changes: 153 additions & 0 deletions hosts/download/datafile_com.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<?php
if (!defined('RAPIDLEECH')) {
require_once 'index.html';
exit;
}

class datafile_com extends DownloadClass {

public function Download($link) {
global $premium_acc;

if (!$_REQUEST['step']) {
$this->page = $this->GetPage($link);
is_present($this->page, 'File not found');
$this->cookie = GetCookiesArr($this->page);
}
$this->link = $link;
$this->posturl = 'https://www.datafile.com';
if ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_user'] && $_REQUEST['premium_pass']) || ($premium_acc['datafile_com']['user'] && $premium_acc['datafile_com']['pass']))) {
return $this->Premium();
} elseif ($_REQUEST['step'] == 1) {
return $this->DownloadFree();
} else {
return $this->PrepareFree();
}
}

private function Premium() {
$filename = cut_str($this->page, '<div class="file-name">', '</div>');
$cookie = $this->login();
$page = $this->GetPage($this->link, $cookie);
if (!preg_match('/Location: (\/[^\s\t\r\n]+)/i', $page, $rd)) html_error('Error[Redirect Link - PREMIUM not found!]');
$page = $this->GetPage($this->posturl . $rd[1], $cookie, 0, $this->link);
if (!preg_match('/Location: (https?:\/\/n\d+\.datafile\.com\/[^\s\t\r\n]+)/i', $page, $dl)) html_error('Error[Download Link - PREMIUM not found!]');
$dlink = trim($dl[1]);
$this->RedirectDownload($dlink, $filename, $cookie, 0, $this->link, $filename);
}

private function login() {
global $premium_acc;

$user = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["datafile_com"] ["user"]);
$pass = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["datafile_com"] ["pass"]);
if (empty($user) || empty($pass)) html_error("Login failed, username or password is empty!");

$post = array();
$post['login'] = $user;
$post['password'] = $pass;
$post['remember_me'] = 0;
$post['remember_me'] = 1;
$post['btn'] = '';
$page = $this->GetPage($this->posturl . '/login.html', $this->cookie, $post, $this->posturl . '/login.html');
$cookie = GetCookiesArr($page, $this->cookie);
is_present($page, 'Incorrect login or password!');

//check account
$page = $this->GetPage($this->posturl . '/profile.html', $cookie, 0, $this->posturl . '/index.html');
is_notpresent($page, 'Premium Expires', 'Account isn\'t Premium?');

return $cookie;
}

private function DownloadFree() {
$post = array();
foreach ($_POST['temp'] as $k => $v) {
$post[$k] = $v;
}
$post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
$post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
$recap = $_POST['recap'];
$filename = $_POST['filename'];
$this->cookie = urldecode($_POST['cookie']);
$page = $this->GetPage($this->posturl . '/files/ajax.html', $this->cookie, $post, $this->link, 0, 1);
$json = $this->Get_Reply($page);
if ($json['success'] == 0) {
echo "<div align='center'><font color='red'><b>{$json['msg']}</b></font></div>";
$data = $this->DefaultParamArr($this->link, $this->cookie);
foreach ($_POST['temp'] as $k => $v) {
$data["temp[{$k}]"] = $v;
}
$data['step'] = 1;
$data['recap'] = $recap;
$data['filename'] = $filename;
$this->Show_reCaptcha($recap, $data);
exit();
}
if (empty($json['link'])) html_error('Error[Download Link - FREE not found!]');
$this->RedirectDownload($json['link'], $filename, $this->cookie, 0, $this->link, $filename);
}

private function PrepareFree() {
if ($_REQUEST['step'] == 'countdown') {
$this->cookie = urldecode($_POST['cookie']);
$this->page = $this->GetPage($this->link, $this->cookie);
} else {
if (!preg_match("/counter\.contdownTimer\('(\d+)'/", $this->page, $w)) html_error('Error[Timer not found!]');
if ($w[1] < 120) $this->CountDown($w[1]);
else {
$data = $this->DefaultParamArr($this->link, $this->cookie);
$data['step'] = 'countdown';
$this->JSCountdown($w[1], $data);
}
}
if (stripos($this->page, 'Recaptcha')) {
$data = $this->DefaultParamArr($this->link, $this->cookie);
$data['temp[doaction]'] = 'getFileDownloadLink';
$data['temp[fileid]'] = cut_str($this->page, "getFileDownloadLink('", "'");

if (!preg_match('/\/challenge\?k=([^"]+)"/', $this->page, $c) || !preg_match('/\/noscript\?k=([^"]+)"/', $this->page, $c)) html_error('Error[Captcha Data not found!]');
$data['step'] = 1;
$data['filename'] = cut_str($this->page, '<div class="file-name">', '</div>');
$data['recap'] = $c[1];
$this->Show_reCaptcha($c[1], $data);
exit();
}
}

private function Show_reCaptcha($pid, $inputs) {
global $PHP_SELF;
if (!is_array($inputs)) {
html_error("Error parsing captcha data.");
}
// Themes: 'red', 'white', 'blackglass', 'clean'
echo "<script language='JavaScript'>var RecaptchaOptions={theme:'white', lang:'en'};</script>\n";
echo "\n<center><form name='dl' action='$PHP_SELF' method='post' ><br />\n";
foreach ($inputs as $name => $input) {
echo "<input type='hidden' name='$name' value='$input' />\n";
}
echo "<script type='text/javascript' src='http://www.google.com/recaptcha/api/challenge?k=$pid'></script>";
echo "<noscript><iframe src='http://www.google.com/recaptcha/api/noscript?k=$pid' height='300' width='500' frameborder='0'></iframe><br />";
echo "<textarea name='recaptcha_challenge_field' rows='3' cols='40'></textarea><input type='hidden' name='recaptcha_response_field' value='manual_challenge' /></noscript><br />";
echo "<input type='submit' name='submit' onclick='javascript:return checkc();' value='Enter Captcha' />\n";
echo "<script type='text/javascript'>/*<![CDATA[*/\nfunction checkc(){\nvar capt=document.getElementById('recaptcha_response_field');\nif (capt.value == '') { window.alert('You didn\'t enter the image verification code.'); return false; }\nelse { return true; }\n}\n/*]]>*/</script>\n";
echo "</form></center>\n</body>\n</html>";
exit;
}

private function Get_Reply($page) {
if (!function_exists('json_decode')) html_error("Error: Please enable JSON in php.");
$json = substr($page, strpos($page, "\r\n\r\n") + 4);
$json = substr($json, strpos($json, "{"));
$json = substr($json, 0, strrpos($json, "}") + 1);
$rply = json_decode($json, true);
if (!$rply || (is_array($rply) && count($rply) == 0)) html_error("Error getting json data.");
return $rply;
}

}

/*
* Written by Tony Fauzi Wihana/Ruud v.Tony 24/04/2013
*/
?>
Loading

0 comments on commit 93fa0cf

Please sign in to comment.