Skip to content

Commit 80235e2

Browse files
committed
Happy New Year, also hotfix for rar5 listing due a typo
Added some flush and ob_flush calls Added 2 plugins since lastest commit
1 parent 4df472b commit 80235e2

5 files changed

Lines changed: 128 additions & 3 deletions

File tree

classes/http.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT
384384
$lastChunkTime = $time;
385385
$speed = @round((($bytesReceived - $last) / 1024) / $chunkTime, 2);
386386
echo "<script type='text/javascript'>pr('$percent', '$received', '$speed');</script>";
387+
flush();
388+
ob_flush();
387389
$last = $bytesReceived;
388390
}
389391
if (!empty($bytesTotal) && ($bytesReceived + $chunkSize) > $bytesTotal) $chunkSize = $bytesTotal - $bytesReceived;
@@ -783,6 +785,7 @@ function upfile($host, $port, $url, $referer, $cookie, $post, $file, $filename,
783785
$percent = round($totalsend / $fileSize * 100, 2);
784786
echo "<script type='text/javascript'>pr('$percent', '" . bytesToKbOrMbOrGb($totalsend) . "', '$speed');</script>\n";
785787
flush();
788+
ob_flush();
786789
}
787790

788791
if ($errno || $errstr) {
@@ -991,6 +994,7 @@ function putfile($host, $port, $url, $referer, $cookie, $file, $filename, $proxy
991994
$percent = round($totalsend / $fileSize * 100, 2);
992995
echo "<script type='text/javascript'>pr('$percent', '" . bytesToKbOrMbOrGb($totalsend) . "', '$speed');</script>\n";
993996
flush();
997+
ob_flush();
994998
}
995999

9961000
if ($errno || $errstr) {

classes/rar.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function listthem($password = '', $dest_dir, $debug_id) {
182182
}
183183
$rar_onfile = !$rar_onfile;
184184
} else {
185-
if (preg_match('/^(\*)?(?:\s+[\w\.]{7}|(?(1)|\s)[dl\-](?:[r\-][w\-][x\-]){3})\s+(\d+)\s+\d+\s\d+%\s+(?:[\w\-]{10}|[\w\-]{8})\s+[\d:]{4,5}\s+[\w\.]{8}\s+([^\r\n]+)$/', $rar_line, $attr)) {
185+
if (preg_match('/^(\*)?(?:\s+[\w\.]{7}|(?(1)|\s)[dl\-](?:[r\-][w\-][x\-]){3})\s+(\d+)\s+\d+\s+\d+%\s+(?:[\w\-]{10}|[\w\-]{8})\s+[\d:]{4,5}\s+[\w\.]{8}\s+([^\r\n]+)$/', $rar_line, $attr)) {
186186
$rar_files[$attr[3]]['size'] = $attr[2];
187187
if (!$rar_needs_pass && !empty($attr[1])) $rar_needs_pass = true;
188188
}
@@ -292,8 +292,9 @@ function runit($params, $extra = '', $jsoutid = '', $debug_id = 0) {
292292
if ($pos_tmp[0] === 0) $pos_found_s = 'Testing ' . basename(substr($pos_found_s, 12));
293293
$pos_found_s = str_replace(array("\r\n", "\n", "\r"), '' , $pos_found_s);
294294
}
295-
echo "<script type='text/javascript'>rar_st('$jsoutid', '" . addslashes($pos_found_s) . " {$num_last}%')</script>\r\n";
295+
echo "<script type='text/javascript'>/* <![CDATA[ */rar_st('$jsoutid', '" . addslashes($pos_found_s) . " {$num_last}%')/* ]]> */</script>\r\n";
296296
flush();
297+
ob_flush();
297298
if ($num_last == 100) $pos_found_s = '';
298299
}
299300
}

hosts/download/hosts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
$host = array();
33
$d = dir(HOST_DIR . 'download/');
4-
$HostnamesToFix = array('d.h.st' => 'd-h.st', 'ex.load.com' => 'ex-load.com', 'share.online.biz' => 'share-online.biz');
4+
$HostnamesToFix = array('d.h.st' => 'd-h.st', 'ex.load.com' => 'ex-load.com', 'samsung.firmware.org' => 'samsung-firmware.org', 'share.online.biz' => 'share-online.biz');
55
$HostnamesToIgnore = array('hosts', 'genericxfs.dl');
66
while (false !== ($entry = $d->read())) {
77
if (strtolower(strrchr($entry, '.')) == '.php' && stripos($entry, '.JD') === false) {

hosts/download/littlebyte_net.php

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
if (!defined('RAPIDLEECH')) {
4+
require_once('index.html');
5+
exit;
6+
}
7+
8+
class littlebyte_net extends DownloadClass {
9+
private $page, $cookie = array('lng' => 'EN'), $link, $baseUrl, $fid, $fuid;
10+
public function Download($link) {
11+
if (!preg_match('@(http://littlebyte\.net/)download/(\d+)\.(\w+)/[^/\r\n\"\'<>]+\.html@i', $link, $fid)) html_error('Invalid Link?.');
12+
$this->link = $GLOBALS['Referer'] = $fid[0];
13+
$this->baseUrl = $fid[1];
14+
$this->fid = $fid[2];
15+
$this->fuid = $fid[3];
16+
17+
$this->page = $this->GetPage($this->link, $this->cookie);
18+
is_present($this->page, 'There are no files to be shown', 'File Not Found or Deleted.');
19+
$this->cookie = GetCookiesArr($this->page, $this->cookie);
20+
21+
// Only FreeDL at the Moment.
22+
return $this->FreeDL();
23+
}
24+
25+
private function FreeDL() {
26+
$post = array(
27+
'action' => 'getSlowDownload',
28+
'params%5Bfile_id%5D' => $this->fid,
29+
'params%5Bfile_uid%5D' => $this->fuid,
30+
);
31+
$page = $this->GetPage($this->baseUrl . 'ajax.php', $this->cookie, $post);
32+
if (preg_match('@Next free download will be available for you after \d+ minutes@', $page, $err)) html_error("FreeDL Error: {$err[0]}");
33+
34+
$post = array('action' => 'checkCaptcha');
35+
if (!preg_match('@\s*(captchaId)\s*:\s*(\d+)\s*,\s*(captchaHash)\s*:\s*\'(\w+)\'@', $page, $captchaData)) html_error('CAPTCHA Data Not Found.');
36+
$post[$captchaData[1]] = $captchaData[2];
37+
$post[$captchaData[3]] = $captchaData[4];
38+
if (preg_match('@\.html(\'<h1>(\d{4})</h1>\');@i', $page, $captcha)) {
39+
$captcha = $captcha[1];
40+
} else if (preg_match('@://((?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)/(?:(?:frame)?video|embed)/([\w\.\-]+)@i', $page, $captcha)) {
41+
$video = $this->GetPage("http://{$captcha[1]}/video/{$captcha[2]}");
42+
if (preg_match("@\nLocation: https?://((?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)/video/({$captcha[2]})@i", $video, $captcha)) {
43+
$video = $this->GetPage("http://{$captcha[1]}/video/{$captcha[2]}");
44+
}
45+
if (!preg_match('@[\s\,]title\s*:\s*"([^"]+)"\s*,@i', $video, $captcha) || !preg_match('@\b(\d{4})\b@', preg_replace('@\D@', ' ', $captcha[1]), $captcha)) html_error('Video "CAPTCHA" Response Not Found.');
46+
$captcha = $captcha[1];
47+
} else html_error('Video "CAPTCHA" Not Found.');
48+
$post['captcha'] = $captcha;
49+
50+
//if (!preg_match('@[\s,]freeRemind\s*=\s*(\d+)\s*;@i', $page, $cD)) html_error('Countdown Not Found.');
51+
//if ($cD[1] > 0) $this->Countdown($cD[1] + 2);
52+
53+
$page = $this->GetPage($this->baseUrl . 'ajax.php', $this->cookie, $post);
54+
$reply = $this->json2array($page, 'Error At FreeDL Post');
55+
if (empty($reply['status'])) html_error('Unexpected Response At FreeDL.');
56+
57+
if ($reply['status'] != 'OK') {
58+
if ($reply['status'] == 'ERROR') {
59+
if (array_key_exists('content', $reply)) {
60+
if (is_null($reply['content'])) html_error('Invalid "CAPTCHA" Response"');
61+
else textarea($reply['content']);
62+
}
63+
html_error('Unknown FreeDL Error.');
64+
} else if ($reply['status'] == 'RELOAD') html_error('FreeDL Limit Reached.');
65+
else html_error('Unknown FreeDL Error: ' . htmlspecialchars($reply['status']));
66+
} else if (empty($reply['content']) || !preg_match('@https?://cdn\d+.littlebyte\.net/files/[^\r\n\t\"\'<>]+@i', $reply['content'], $DL)) html_error('Download Link Not Found.');
67+
68+
return $this->RedirectDownload($DL[0]);
69+
}
70+
}
71+
72+
// [31-12-2016] Written by Th3-822.
73+
74+
?>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
if (!defined('RAPIDLEECH')) {
4+
require_once('index.html');
5+
exit();
6+
}
7+
8+
class samsung_firmware_org extends DownloadClass {
9+
public function Download($link) {textarea($link);
10+
if (!preg_match('@https://samsung-firmware\.org/download/[\w\-\% ]+/[\w\-\.]+/\w{3}/(?:\w{13}/){2}@i', $link, $_link)) html_error('Invalid Link?.');
11+
$link = $GLOBALS['Referer'] = $_link[0];
12+
13+
$pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
14+
if (($_REQUEST['premium_acc'] == 'on' && ($pA || (!empty($GLOBALS['premium_acc']['samsung_firmware_org']['user']) && !empty($GLOBALS['premium_acc']['samsung_firmware_org']['pass']))))) {
15+
$user = ($pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['samsung_firmware_org']['user']);
16+
$pass = ($pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['samsung_firmware_org']['pass']);
17+
} else return html_error('This Site Requires Login to Download');
18+
19+
$cookie = array('hl' => 'en');
20+
$purl = 'https://samsung-firmware.org/login';
21+
$page = $this->GetPage($purl, $cookie);
22+
if (!($csrf = trim(cut_str($page, 'name="_csrf_token" value="', '"')))) html_error('Login CSRF Token Not Found');
23+
$loginCookie = GetCookiesArr($page, $cookie);
24+
25+
$post = array();
26+
$post['_csrf_token'] = html_entity_decode($csrf);
27+
$post['_username'] = $user;
28+
$post['_password'] = $pass;
29+
$post['_submit'] = 'Login';
30+
31+
$page = $this->GetPage('https://samsung-firmware.org/login_check', $loginCookie, array_map('urlencode', $post), $purl);
32+
is_present($page, $purl, 'Invalid Login?');
33+
$cookie = GetCookiesArr($page, $cookie);
34+
if (empty($cookie['PHPSESSID'])) html_error('Login Cookie Not Found');
35+
36+
$page = $this->GetPage($link, $cookie);
37+
38+
if (!preg_match('@https://dl\.samsung-firmware\.org/\w+/\w+/[^\r\n\t\"\'<>]+@i', $page, $DL)) html_error('Download Link Not Found');
39+
40+
$this->RedirectDownload($DL[0]);
41+
}
42+
}
43+
44+
//[30-12-2016] Written by Th3-822.
45+
46+
?>

0 commit comments

Comments
 (0)