本文整理汇总了PHP中CookiesToStr函数的典型用法代码示例。如果您正苦于以下问题:PHP CookiesToStr函数的具体用法?PHP CookiesToStr怎么用?PHP CookiesToStr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CookiesToStr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Download
public function Download($link)
{
if ($_REQUEST['step'] == '1') {
$post['captcha'] = $_POST['captcha'];
$post['submit'] = 'Download';
$dlink = urldecode($_POST['referer']);
$cookie = urldecode($_POST['cookie']);
$link = urldecode($_POST['link']);
$FileName = basename(parse_url($dlink, PHP_URL_PATH));
$this->RedirectDownload($dlink, $FileName, $cookie, $post, $link);
exit;
} else {
$page = $this->GetPage($link);
is_present($page, "File not found.");
$cookie = CookiesToStr(GetCookiesArr($page));
if (preg_match('%<a href="([^"]+)" class="ajax button button-devil">%', $page, $match)) {
$free = "http://download.hellshare.com" . $match[1];
}
$page = $this->GetPage($free, $cookie, 0, $link . "\r\nX-Requested-With: XMLHttpRequest");
is_present($page, "The server is under the maximum load.");
is_present($page, "You exceeded your today's limit for free download. You can download only 1 files per 24 hours.");
$postlink = str_replace("\\", "", cut_str($page, 'style=\\"margin-bottom:0\\" action=\\"', '\\" method=\\"POST\\">'));
$caplink = str_replace("\\", "", cut_str($page, 'id=\\"captcha-img\\"src=\\"', '\\" \\/>'));
$data = $this->DefaultParamArr($link, $cookie, $postlink);
$data['step'] = '1';
$this->EnterCaptcha($caplink, $data);
exit;
}
}
示例2: FreeDL
private function FreeDL()
{
if (empty($_POST['step']) || $_POST['step'] != '1') {
if (!preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w|\\-]+)@i', $this->page, $pid)) {
$pid = array(1 => '6LcEvs0SAAAAAAykpzcaaxpegnSndWcEWYsSMs0M');
}
$data = $this->DefaultParamArr($this->link, empty($this->cookie) ? 0 : encrypt(CookiesToStr($this->cookie)));
$data['step'] = '1';
$this->Show_reCaptcha($pid[1], $data);
exit;
} else {
if (empty($_POST['recaptcha_response_field'])) {
html_error('You didn\'t enter the image verification code.');
}
if (!empty($_POST['cookie'])) {
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
}
$query = array();
$query['type'] = 'recaptcha';
$query['challenge'] = $_POST['recaptcha_challenge_field'];
$query['capture'] = $_POST['recaptcha_response_field'];
$page = $this->GetPage($this->link . '?' . http_build_query($query), $this->cookie);
$reply = $this->Get_Reply($page);
if (!empty($reply['err'])) {
html_error('Error: ' . htmlentities($reply['err']));
}
if (empty($reply['href'])) {
html_error('Error: Download link not found.');
}
$this->RedirectDownload($reply['href'], urldecode(basename(parse_url($reply['href'], PHP_URL_PATH))));
}
}
示例3: FreeDL
private function FreeDL($link)
{
if (!empty($_POST['step']) && $_POST['step'] == 1) {
if (empty($_POST['captcha'])) {
html_error('You didn\'t enter the image verification code.');
}
$this->cookie = !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array();
$this->cookie['lang'] = 'english';
$post = array('recaptcha_challenge_field' => $_POST['challenge'], 'recaptcha_response_field' => $_POST['captcha']);
$post['op'] = $_POST['T8']['op'];
$post['id'] = $_POST['T8']['id'];
$post['rand'] = $_POST['T8']['rand'];
$post['referer'] = '';
$post['method_free'] = $_POST['T8']['method_free'];
$post['down_script'] = 1;
$page = $this->GetPage($link, $this->cookie, $post);
is_present($page, '>Skipped countdown', 'Error: Skipped countdown?.');
is_present($page, '>Wrong captcha<', 'Error: Wrong Captcha Entered.');
if (preg_match('@You can download files up to \\d+ [KMG]b only.@i', $page, $err)) {
html_error('Error: ' . $err[0]);
}
if (!preg_match('@https?://[^/\\r\\n\\:]+(?:\\:\\d+)?/(?:(?:files)|(?:dl?))/[^\'\\"\\t<>\\r\\n]+@i', $page, $dlink)) {
html_error('Error: Download link not found.');
}
$FileName = urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)));
$this->RedirectDownload($dlink[0], $FileName);
} else {
$page2 = cut_str($this->page, 'Form method="POST" action=', '</form>');
//Cutting page
$post = array();
$post['op'] = cut_str($page2, 'name="op" value="', '"');
$post['usr_login'] = empty($this->cookie['xfss']) ? '' : $this->cookie['xfss'];
$post['id'] = cut_str($page2, 'name="id" value="', '"');
$post['fname'] = cut_str($page2, 'name="fname" value="', '"');
$post['referer'] = '';
$post['method_free'] = urlencode(html_entity_decode(cut_str($page2, 'name="method_free" value="', '"')));
$page = $this->GetPage($link, $this->cookie, $post);
if (preg_match('@You have to wait (?:\\d+ \\w+,\\s)?\\d+ \\w+ till next download@', $page, $err)) {
html_error('Error: ' . $err[0]);
}
$page2 = cut_str($page, '<form name="F1" method="POST"', '</form>');
//Cutting page
if (!preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w\\.\\-]+)@i', $page, $pid)) {
html_error('Error: reCAPTCHA not found.');
}
if (!preg_match('@<div id="countdown_str"[^>]*>[^<>]+<p>[^<>]*<h2[^>]*>(\\d+)</h2>[^<>]+</p>[^<>]+</div>@i', $page2, $count)) {
html_error('Countdown not found.');
}
$this->CountDown($count[1]);
$data = $this->DefaultParamArr($link, empty($this->cookie['xfss']) ? 0 : encrypt(CookiesToStr($this->cookie)));
$data['T8[op]'] = cut_str($page2, 'name="op" value="', '"');
is_notpresent($data['T8[op]'], 'download', 'Error parsing download post data (2).');
$data['T8[id]'] = cut_str($page2, 'name="id" value="', '"');
$data['T8[rand]'] = cut_str($page2, 'name="rand" value="', '"');
$data['T8[method_free]'] = urlencode(html_entity_decode(cut_str($page2, 'name="method_free" value="', '"')));
$data['step'] = 1;
$this->DL_reCaptcha($pid[1], $data);
}
}
示例4: FreeDL
private function FreeDL($link)
{
if (empty($_POST['step']) || $_POST['step'] != 1) {
if (preg_match('@/lightbox_block_download\\.php\\?(min=-?\\d+&)?sec=\\d+@i', $this->page)) {
$page = $this->GetPage('http://uploadhero.com/lightbox_block_download.php', $this->cookie);
if (!preg_match('@(?:id="minn">(\\d+)</span>[\\r\\n\\s\\r]*)*<span [^<>]*id="secondss">(\\d+)</span>@i', $page, $timer)) {
html_error('The last download was performed fewer than 30 minutes, you have to wait.');
}
$wait = $timer[2];
if (!empty($timer[1])) {
$wait += $timer[1] * 60;
}
$data = $this->DefaultParamArr($link);
return $this->JSCountDown($wait, $data, 'You have to wait before downloading again');
}
if (!preg_match('@<img src="((https?://(?:[^/\\r\\n<>\\"]+\\.)?uploadhero\\.com)?/captchadl\\.php\\?[^\\r\\n<>\\"]+)"@i', $this->page, $cimg)) {
html_error('Error: CAPTCHA not found.');
}
$cimg = empty($cimg[2]) ? 'http://uploadhero.com' . $cimg[1] : $cimg[1];
//Download captcha img.
$page = $this->GetPage($cimg, $this->cookie);
$capt_img = substr($page, strpos($page, "\r\n\r\n") + 4);
$imgfile = DOWNLOAD_DIR . get_class($this) . '_captcha.jpg';
if (file_exists($imgfile)) {
unlink($imgfile);
}
if (!write_file($imgfile, $capt_img)) {
html_error('Error getting CAPTCHA image.');
}
$data = $this->DefaultParamArr($link, encrypt(CookiesToStr($this->cookie)));
$data['step'] = 1;
$this->EnterCaptcha($imgfile . '?' . time(), $data, 20);
exit;
}
if (empty($_POST['captcha'])) {
html_error('You didn\'t enter the image verification code.');
}
$this->cookie = !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array();
$this->cookie['lang'] = 'en';
$query = 'code=' . urlencode($_POST['captcha']);
$page = $this->GetPage($link . (strpos($link, '?') ? '&' : '?') . $query, $this->cookie);
is_present($page, 'border: solid 1px #c60000;', 'Wrong captcha entered.');
if (!preg_match('@setTimeout[\\s\\t]*\\([\\r\\n\\s\\t]*function[\\s\\t]*\\(\\)[\\r\\n\\s\\t]*{[\\r\\n\\s\\t]*omfg\\(\\);[\\r\\n\\s\\t]*},[\\s\\t]*(\\d+)[\\s\\t]*\\);@i', $page, $count)) {
html_error('Countdown not found.');
}
$count[1] /= 1000;
if ($count[1] > 0) {
$this->CountDown($count[1]);
}
if (!preg_match('@https?://[^/\\r\\n\'\\"\\t<>]+/\\?d=[^\\r\\n\'\\"\\t<>]+/[^\\r\\n\'\\"\\t<>]+@i', $page, $dlink)) {
html_error('Error: Download link not found.');
}
$this->RedirectDownload($dlink[0], 'uploadhero_fr');
}
示例5: FreeDL
private function FreeDL()
{
$url = 'http://uploaded.net';
$errs = array('host' => 'Download of this file isn\'t available right now, try again later.', 'limit-dl' => 'Free download limit reached.', 'parallel' => 'You\'re already downloading a file.', 'size' => 'Only Premium users can download this file.', 'slot' => 'Free download of this file isn\'t available right now, try again later.', 'captcha' => 'Wrong CAPTCHA entered.');
if (empty($_POST['step']) || $_POST['step'] != 1) {
// Find countdown
if (!preg_match('@<span[^>]*>[^<>]+<span[^>]*>(\\d+)</span>[\\s\\t\\r\\n]+seconds[^<>]*</span>@i', $this->page, $cD)) {
html_error('Countdown not found.');
}
// Check slots
$page = $this->GetPage("{$url}/io/ticket/slot/" . $this->fid, $this->cookie, 0, 0, 0, 1);
if (stripos($page, 'succ:true') === false) {
if (preg_match('@\\"?err\\"?\\s*:\\s*\\"((?:[^\\"]+(?:\\\\")?)+)(?<!\\\\)\\"@i', $page, $err) && !empty($errs[$err[1]])) {
html_error($errs[$err[1]]);
} else {
html_error($errs['slot']);
}
}
// Download js and find site's recaptcha key
$js = $this->GetPage("{$url}/js/download.js", $this->cookie);
if (!preg_match('@Recaptcha\\.create[\\s\\t]*\\([\\s\\t]*\\"[\\s\\t]*([\\w\\-]+)[\\s\\t]*\\"@i', $js, $cpid)) {
html_error('reCAPTCHA Not Found.');
}
// Do countdown
if ($cD[1] > 0) {
$this->CountDown($cD[1]);
}
// Prepare data for Show_reCaptcha and call it
$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
$data['step'] = '1';
return $this->Show_reCaptcha($cpid[1], $data);
}
if (empty($_POST['recaptcha_response_field'])) {
html_error('You didn\'t enter the image verification code.');
}
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
$post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']);
$page = $this->GetPage("{$url}/io/ticket/captcha/" . $this->fid, $this->cookie, $post, 0, 0, 1);
if (!preg_match('@https?://(?:[a-zA-Z\\d\\-]+\\.)+uploaded\\.(?:net|to)/dl/[^\\r\\n\\s\\t\'\\"<>]+@i', $page, $dl)) {
if (preg_match('@\\"?err\\"?\\s*:\\s*\\"((?:[^\\"]+(?:\\\\")?)+)(?<!\\\\)\\"@i', $page, $err)) {
if (!empty($errs[$err[1]])) {
html_error($errs[$err[1]]);
}
is_present($err[1], 'free downloads for this hour', $errs['limit-dl'] . ' Wait and hour an try again.');
html_error('Unknown error after sending captcha: ' . htmlentities($err[1]));
}
html_error('Download Link Not Found.');
}
$this->RedirectDownload($dl[0], 'uploaded_net_fr', $this->cookie);
}
示例6: Download
public function Download($link)
{
global $premium_acc;
$page = $this->GetPage($link);
is_present($page, 'That file is not available for download');
$CookieArr = GetCookiesArr($page);
$cookie = CookiesToStr($CookieArr);
$url = "http://filesflash.com/";
$email = $_REQUEST["premium_user"] ? $_REQUEST["premium_user"] : $premium_acc["filesflash_com"]["user"];
$pass = $_REQUEST["premium_pass"] ? $_REQUEST["premium_pass"] : $premium_acc["filesflash_com"]["pass"];
if (!empty($email) && !empty($pass)) {
$post = array();
$post['email'] = urlencode($email);
$post['password'] = urlencode($pass);
$post['submit'] = 'Login';
$page = $this->GetPage($url . "login.php", $cookie, $post, $url);
is_present($page, "Invalid email address or password.");
$cookie = CookiesToStr(array_merge($CookieArr, GetCookiesArr($page)));
// check account
$page = $this->GetPage($url . "myaccount.php", $cookie, 0, $url . "index.php");
is_present($page, "<td>Premium Status:</td><td>Not Premium", "Account Status: Free");
// start download link
$page = $this->GetPage($link, $cookie);
if (!preg_match("@Location: (http:\\/\\/[^\r\n]+)@i", $page, $dl)) {
html_error("Error: Download Link [PREMIUM] not found!");
}
$dlink = trim($dl[1]);
$filename = basename(parse_url($dlink, PHP_URL_PATH));
$this->RedirectDownload($dlink, $filename, $cookie);
} else {
$post = array();
$post['token'] = cut_str($page, 'name="token" value="', '"');
$post['freedl'] = " Free Download ";
$page = $this->GetPage($url . 'freedownload.php', $cookie, $post, $link);
is_present($page, "Your link has expired. Please try again.");
if (!preg_match('/count=(\\d+)/', $page, $wait)) {
html_error("Error: Timer not found!");
}
$this->CountDown($wait[1]);
$dlink = cut_str($page, '<div id="link" style="display:none"><a href="', '">');
if (!$dlink) {
html_error("Error: Download Link [FREE] not found???");
}
$FileName = basename(parse_url($dlink, PHP_URL_PATH));
$this->RedirectDownload($dlink, $FileName, $cookie, 0, $url . 'freedownload.php');
exit;
}
}
示例7: FreeDL
private function FreeDL()
{
switch ($_POST['step']) {
default:
is_present($this->page, 'Your Traffic is used up for today!');
if (!preg_match('@\\svar\\s+time\\s*=\\s*(\\d+)@i', $this->page, $cD)) {
html_error('Countdown not found.');
}
$this->cookie['ads_download'] = '1';
if ($cD[1] >= 0) {
if ($cD[1] > 59) {
$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
$data['step'] = '1';
return $this->JSCountdown($cD[1] + 1, $data);
} else {
$this->CountDown($cD[1] + 1);
}
}
case '1':
$page = $this->GetPage($this->link, $this->cookie, array('section' => 'benefit', 'did' => '0'));
if (!preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w\\.\\-]+)@i', $page, $cpid)) {
html_error('CAPTCHA not found.');
}
$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
$data['step'] = '2';
return $this->reCAPTCHA($cpid[1], $data);
case '2':
break;
}
if (empty($_POST['recaptcha_response_field'])) {
html_error('You didn\'t enter the image verification code.');
}
$post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']);
$post['section'] = 'waitingtime';
$post['did'] = '0';
$page = $this->GetPage($this->link, $this->cookie, $post);
is_present($page, 'Wrong Captcha!', 'Login Failed: Wrong CAPTCHA entered.');
if (!preg_match($this->DLRegexp, $page, $DL)) {
html_error('Download Link Not Found.');
}
$this->RedirectDownload($DL[0], 'T8_Freakshare_FDL');
}
示例8: FreeDL
private function FreeDL()
{
if (empty($_POST['step']) || $_POST['step'] != '1') {
if (preg_match('@Next free download from your ip will be available in <b>\\d+ \\w+@i', $this->page, $err)) {
html_error($err[0] . '</b>');
}
if (!preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w\\.\\-]+)@i', $this->page, $pid)) {
html_error('reCAPTCHA not found.');
}
$this->cookie = GetCookiesArr($this->page, $this->cookie);
$data = $this->DefaultParamArr($this->link, empty($this->cookie) ? 0 : encrypt(CookiesToStr($this->cookie)));
$data['step'] = '1';
$this->reCAPTCHA($pid[1], $data);
exit;
} else {
if (empty($_POST['recaptcha_response_field'])) {
html_error('You didn\'t enter the image verification code.');
}
if (!empty($_POST['cookie'])) {
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
}
$query = array();
$query['type'] = 'recaptcha';
$query['challenge'] = urlencode($_POST['recaptcha_challenge_field']);
$query['capture'] = urlencode($_POST['recaptcha_response_field']);
$page = $this->GetPage($this->link . '?' . http_build_query($query), $this->cookie);
$reply = $this->Get_Reply($page);
if (!empty($reply['err'])) {
html_error('Error: ' . htmlentities($reply['err']));
}
if (empty($reply['href']) || !preg_match('@https?://[\\w\\-]+\\.cloudstoreservice\\.net/[^\'\\"\\t<>\\r\\n]+@i', $reply['href'], $dlink)) {
if (!empty($reply['href']) && stripos($reply['href'], '/dl/') === 0) {
html_error('Expired/Used/Invalid DL Session.');
}
html_error('Error: Download link not found.');
}
$this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH))));
}
}
示例9: Login
private function Login()
{
if (!empty($_REQUEST['pA_encrypted']) && !empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) {
$_REQUEST['premium_user'] = decrypt(urldecode($_REQUEST['premium_user']));
$_REQUEST['premium_pass'] = decrypt(urldecode($_REQUEST['premium_pass']));
unset($_REQUEST['pA_encrypted']);
}
$pA = empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true;
$user = $pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['rapidgator_net']['user'];
$pass = $pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['rapidgator_net']['pass'];
if (empty($user) || empty($pass)) {
html_error('Login Failed: User or Password is empty. Please check login data.', 0);
}
$this->cookie = array('lang' => 'en');
// Account is always showed as free if it comes from a file, as i don't send file's link as referer, lets reset the cookies.
$post = array();
$post['LoginForm%5Bemail%5D'] = urlencode($user);
$post['LoginForm%5Bpassword%5D'] = urlencode($pass);
$post['LoginForm%5BrememberMe%5D'] = '1';
if (!empty($_POST['step']) && $_POST['step'] == '1') {
if (empty($_POST['captcha'])) {
html_error('You didn\'t enter the image verification code.');
}
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
$post['LoginForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
}
$purl = 'http://rapidgator.net/';
// There are more of those redirects at login
$rdc = 0;
$page = false;
// False value for starting the loop.
$redir = $purl . 'auth/login';
$this->referer = !empty($GLOBALS['Referer']) && $GLOBALS['Referer'] != $this->link ? $GLOBALS['Referer'] : $purl;
while (($redir = $this->ChkRGRedirs($page, $redir, '(?:/auth/login|/site/ChangeLocation/key/)')) && $rdc < 15) {
$page = cURL($redir, $this->cookie, $post, $this->referer);
$this->cookie = GetCookiesArr($page, $this->cookie);
$this->referer = $redir;
$rdc++;
}
is_present($page, 'Error e-mail or password.', 'Login Failed: Email/Password incorrect.');
is_present($page, 'E-mail is not a valid email address.', 'Login Failed: Login isn\'t an email address.');
is_present($page, 'We discovered that you try to access your account from unusual location.', 'Login Failed: Login Blocked By IP, Check Account Email And Follow The Steps To Add IP to Whitelist.');
if (stripos($page, 'The code from a picture does not coincide') !== false) {
if (!empty($_POST['step']) && $_POST['step'] == '1') {
html_error('Login Failed: Incorrect CAPTCHA response.');
}
if (!preg_match('@(https?://(?:[^\\./\\r\\n\'\\"\\t\\:]+\\.)?rapidgator\\.net(?:\\:\\d+)?)?/auth/captcha/\\w+/\\w+@i', $page, $imgurl)) {
html_error('Error: CAPTCHA not found.');
}
$imgurl = empty($imgurl[1]) ? 'http://rapidgator.net' . $imgurl[0] : $imgurl[0];
//Download captcha img.
$capt_page = cURL($imgurl, $this->cookie);
$capt_img = substr($capt_page, strpos($capt_page, "\r\n\r\n") + 4);
$imgfile = DOWNLOAD_DIR . 'rapidgator_captcha.png';
if (file_exists($imgfile)) {
unlink($imgfile);
}
if (!write_file($imgfile, $capt_img)) {
html_error('Error getting CAPTCHA image.');
}
unset($capt_page, $capt_img);
$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
$data['step'] = '1';
$data['premium_acc'] = 'on';
// I should add 'premium_acc' to DefaultParamArr()
if ($pA) {
$data['pA_encrypted'] = 'true';
$data['premium_user'] = urlencode(encrypt($user));
// encrypt() will keep this safe.
$data['premium_pass'] = urlencode(encrypt($pass));
// And this too.
}
$this->EnterCaptcha($imgfile . '?' . time(), $data);
exit;
}
//is_present($page, 'The code from a picture does not coincide', 'Login Failed: Captcha... (T8: I will add it later)');
if (empty($this->cookie['user__'])) {
html_error("Login Error: Cannot find 'user__' cookie.");
}
$this->cookie['lang'] = 'en';
$page = cURL($purl, $this->cookie, 0, $purl . 'auth/login');
is_present($page, '>Free</a>', 'Account isn\'t premium');
$this->PremiumDL();
}
示例10: QSelector
private function QSelector()
{
$VR = array('>1080', 1080, 720, 480, 360, 270, 240, 144);
$VC = array('MP4', 'WebM', 'FLV', '3GP');
$AC = array('AAC', 'Vorbis', 'MP3');
$AB = array(192, 128, 96, 64, 36, 24);
$vinfo = array(38 => '0000', 37 => '1000', 46 => '1110', 22 => '2000', 45 => '2110', 44 => '3111', 35 => '3201', 43 => '4111', 34 => '4201', 18 => '4002', 6 => '5223', 5 => '6223', 36 => '6304', 17 => '7305');
// VR VC AC AB
$sizes = array();
/* Add a // at the start of this line for enable this code.
if (extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec')) {
$sizes = array();
$opt = array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLOPT_NOBODY => true); // Redirects may fail with open_basedir enabled
foreach ($this->fmturlmaps as $fmt => $url) {
if (!in_array($fmt, $this->fmts)) continue;
$headers = explode("\r\n\r\n", cURL($url, $this->cookie, 0, 0, 0, $opt));
$headers = ((count($headers) > 2) ? $headers[count($headers) - 2] : $headers[0]) . "\r\n\r\n";
if (substr($headers, 9, 3) == '200' && ($CL = cut_str($headers, "\nContent-Length: ", "\n")) && $CL > 1024) $sizes[$fmt] = bytesToKbOrMbOrGb(trim($CL));
}
unset($headers, $CL);
} //*/
echo "\n<br /><br /><h3 style='text-align: center;'>" . lang(216) . ".</h4>";
echo "\n<center><form name='YT_QS' action='{$GLOBALS['PHP_SELF']}' method='POST'>\n";
echo "<input type='hidden' name='yt_QS' value='on' />\n";
echo '<label><input type="checkbox" name="cleanname" checked="checked" value="1" /><small> Remove non-supported characters from filename</small></label><br />';
echo "<select name='yt_fmt' id='QS_fmt'>\n";
foreach ($this->fmturlmaps as $fmt => $url) {
if (in_array($fmt, $this->fmts) && ($I = str_split($vinfo[$fmt]))) {
echo '<option ' . ($fmt == 18 ? "selected='selected' " : '') . "value='{$fmt}'>[{$fmt}] Video: {$VC[$I[1]]} {$VR[$I[0]]}p | Audio: {$AC[$I[2]]} ~{$AB[$I[3]]} kbps" . (!empty($sizes[$fmt]) ? ' (' . $sizes[$fmt] . ')' : '') . "</option>\n";
}
}
echo "</select>\n";
if (count($this->cookie) > 0) {
$this->cookie = encrypt(CookiesToStr($this->cookie));
}
$data = $this->DefaultParamArr($this->link, $this->cookie);
$data['ytube_mp4'] = 'on';
foreach ($data as $n => $v) {
echo "<input type='hidden' name='{$n}' id='QS_{$n}' value='{$v}' />\n";
}
echo "<input type='submit' name='Th3-822' value='" . lang(209) . "' />\n";
echo "</form></center>\n</body>\n</html>";
exit;
}
示例11: Login
function Login($user, $pass)
{
global $default_acc, $cookie, $domain, $referer, $pauth;
$errors = array('CaptchaInvalid' => 'Wrong CAPTCHA entered.', 'InvalidLogIn' => 'Invalid Login/Pass.', 'CaptchaRequired' => 'Captcha Required.');
if (!empty($_POST['step']) && $_POST['step'] == '1') {
if (empty($_POST['captcha'])) {
html_error('You didn\'t enter the image verification code.');
}
$cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
$post = array();
$post['user%5Blogin%5D'] = urlencode($user);
$post['user%5Bpass%5D'] = urlencode($pass);
$post['user%5Bcaptcha_response%5D'] = urlencode($_POST['captcha']);
$post['user%5Bcaptcha_type%5D'] = urlencode($_POST['c_type']);
$post['user%5Bcaptcha_subtype%5D'] = !empty($_POST['c_subtype']) ? urlencode($_POST['c_subtype']) : '';
$post['user%5Bmemory%5D'] = 'on';
$post['user%5Bsubmit%5D'] = 'Login';
$page = geturl($domain, 80, '/user/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);
is_page($page);
$cookie = GetCookiesArr($page, $cookie);
$x = 0;
while ($x < 3 && stripos($page, "\nLocation: ") !== false && preg_match('@\\nLocation: ((https?://[^/\\r\\n]+)?/[^\\r\\n]*)@i', $page, $redir)) {
$redir = empty($redir[2]) ? 'http://turbobit.net' . $redir[1] : $redir[1];
$url = parse_url($redir);
$page = geturl($url['host'], defport($url), $url['path'] . (!empty($url['query']) ? '?' . $url['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
is_page($page);
$cookie = GetCookiesArr($page, $cookie);
$x++;
}
is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect.');
is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail.');
is_present($page, 'Incorrect verification code', 'Login Failed: Wrong CAPTCHA entered.');
if (empty($redir) || $redir != $referer) {
$page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
is_page($page);
}
is_notpresent($page, '/user/logout">Logout<', 'Login Failed.');
SaveCookies($user, $pass);
// Update cookies file
return $page;
} else {
$post = array();
$post['user%5Blogin%5D'] = urlencode($user);
$post['user%5Bpass%5D'] = urlencode($pass);
$post['user%5Bmemory%5D'] = 'on';
$post['user%5Bsubmit%5D'] = 'Login';
$page = geturl($domain, 80, '/user/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);
is_page($page);
$cookie = GetCookiesArr($page, $cookie);
if (!empty($cookie['user_isloggedin']) && $cookie['user_isloggedin'] == '1') {
$page = geturl($domain, 80, '/', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);
is_page($page);
SaveCookies($user, $pass);
// Update cookies file
return $page;
}
$x = 0;
while ($x < 3 && stripos($page, "\nLocation: ") !== false && preg_match('@\\nLocation: ((https?://[^/\\r\\n]+)?/[^\\r\\n]*)@i', $page, $redir)) {
$redir = empty($redir[2]) ? 'http://turbobit.net' . $redir[1] : $redir[1];
$url = parse_url($redir);
$page = geturl($url['host'], defport($url), $url['path'] . (!empty($url['query']) ? '?' . $url['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
is_page($page);
$cookie = GetCookiesArr($page, $cookie);
$x++;
}
if ($x < 1) {
html_error('Login redirect not found');
}
is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect');
is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail');
if (!preg_match('@(https?://[^/\\r\\n\\t\\s\'\\"<>]+)?/captcha/[^\\r\\n\\t\\s\'\\"<>]+@i', $page, $imgurl)) {
if (stripos($page, '/user/logout">Logout<') !== false) {
$this->SaveCookies($user, $pass);
// Update cookies file
is_present($page, '<u>Turbo Access</u> denied', 'Login Failed: Account isn\'t premium');
return $this->PremiumDL();
} else {
html_error('CAPTCHA not found.');
}
}
$imgurl = empty($imgurl[1]) ? 'http://turbobit.net' . $imgurl[0] : $imgurl[0];
$imgurl = html_entity_decode($imgurl);
if (!preg_match('@\\Wvalue\\s*=\\s*[\'\\"]([^\'\\"\\r\\n<>]+)[\'\\"]\\s+name\\s*=\\s*[\'\\"]user\\[captcha_type\\][\'\\"]@i', $page, $c_type) || !preg_match('@\\Wvalue\\s*=\\s*[\'\\"]([^\'\\"\\r\\n<>]*)[\'\\"]\\s+name\\s*=\\s*[\'\\"]user\\[captcha_subtype\\][\'\\"]@i', $page, $c_subtype)) {
html_error('CAPTCHA data not found.');
}
//Download captcha img.
$url = parse_url($imgurl);
$page = geturl($url['host'], defport($url), $url['path'] . (!empty($url['query']) ? '?' . $url['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
is_page($page);
$capt_img = substr($page, strpos($page, "\r\n\r\n") + 4);
$imgfile = DOWNLOAD_DIR . 'turbobit_captcha.png';
if (file_exists($imgfile)) {
unlink($imgfile);
}
if (!write_file($imgfile, $capt_img)) {
html_error('Error getting CAPTCHA image.');
}
$data = array();
$data['action'] = 'FORM';
$data['cookie'] = urlencode(encrypt(CookiesToStr($cookie)));
//.........这里部分代码省略.........
示例12: QSelector
private function QSelector($link)
{
global $PHP_SELF;
$fmtlangs = array(38 => 377, 37 => 228, 22 => 227, 45 => 225, 35 => 223, 44 => 389, 34 => 222, 43 => 224, 18 => 226, 5 => 221, 17 => 220);
$sizes = array();
/* Add a // at the start of this line for enable this code.
if (extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec')) {
$sizes = array();
$opt = array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLOPT_NOBODY => true); // Redirects may fail with open_basedir enabled
if (!empty($this->cookie)) $opt[CURLOPT_COOKIE] = CookiesToStr($this->cookie);
foreach ($this->fmturlmaps as $fmt => $url) {
if (!in_array($fmt, $this->fmts)) continue;
$headers = explode("\r\n\r\n", cURL($url, $this->cookie, 0, 0, 0, $opt));
$headers = ((count($headers) > 2) ? $headers[count($headers) - 2] : $headers[0]) . "\r\n\r\n";
if (substr($headers, 9, 3) == '200' && ($CL = cut_str($headers, "\nContent-Length: ", "\n")) && $CL > 1024) $sizes[$fmt] = bytesToKbOrMbOrGb(trim($CL));
}
unset($headers, $CL);
} //*/
echo "\n<br /><br /><h3 style='text-align: center;'>" . lang(216) . ".</h4>";
echo "\n<center><form name='YT_QS' action='{$PHP_SELF}' method='POST'>\n";
echo "<input type='hidden' name='yt_QS' value='on' />\n";
echo "<select name='yt_fmt' class='btn btn-inverse dropdown-toggle'> id='QS_fmt'>\n";
foreach ($this->fmturlmaps as $fmt => $url) {
if (in_array($fmt, $this->fmts)) {
echo '<option ' . ($fmt == 18 ? "selected='selected' " : '') . "value='{$fmt}'>" . lang($fmtlangs[$fmt]) . (!empty($sizes[$fmt]) ? ' (' . $sizes[$fmt] . ')' : '') . "</option>\n";
}
}
echo "</select>\n";
if (count($this->cookie) > 0) {
$this->cookie = encrypt(CookiesToStr($this->cookie));
}
$data = $this->DefaultParamArr($link, $this->cookie);
$data['ytube_mp4'] = 'on';
foreach ($data as $n => $v) {
echo "<input type='hidden' name='{$n}' id='QS_{$n}' value='{$v}' />\n";
}
echo "<input type='submit' class='btn btn-success' name='submit' value='" . lang(209) . "' />\n";
echo "</form></center>\n</body>\n</html>";
exit;
}
示例13: putfile
function putfile($host, $port, $url, $referer, $cookie, $file, $filename, $proxy = 0, $pauth = 0, $upagent = 0, $scheme = 'http')
{
global $nn, $lastError, $fp, $fs;
if (empty($upagent)) {
$upagent = rl_UserAgent;
}
$scheme = strtolower("{$scheme}://");
if (!is_readable($file)) {
$lastError = sprintf(lang(65), $file);
return FALSE;
}
$fileSize = getSize($file);
if (!empty($cookie)) {
if (is_array($cookie)) {
$cookies = count($cookie) > 0 ? CookiesToStr($cookie) : 0;
} else {
$cookies = trim($cookie);
}
}
if ($scheme == 'https://') {
if (!extension_loaded('openssl')) {
html_error('You need to install/enable PHP\'s OpenSSL extension to support uploading via HTTPS.');
}
$scheme = 'tls://';
if ($port == 0 || $port == 80) {
$port = 443;
}
}
if (!empty($referer) && ($pos = strpos("\r\n", $referer)) !== 0) {
$origin = parse_url($pos ? substr($referer, 0, $pos) : $referer);
$origin = strtolower($origin['scheme']) . '://' . strtolower($origin['host']) . (!empty($origin['port']) && $origin['port'] != defport(array('scheme' => $origin['scheme'])) ? ':' . $origin['port'] : '');
} else {
$origin = ($scheme == 'tls://' ? 'https://' : $scheme) . $host . ($port != 80 && ($scheme != 'tls://' || $port != 443) ? ':' . $port : '');
}
if ($proxy) {
list($proxyHost, $proxyPort) = explode(':', $proxy, 2);
$host = $host . ($port != 80 && ($scheme != 'tls://' || $port != 443) ? ':' . $port : '');
$url = "{$scheme}{$host}{$url}";
}
if ($scheme != 'tls://') {
$scheme = '';
}
$request = array();
$request[] = 'PUT ' . str_replace(' ', '%20', $url) . ' HTTP/1.1';
$request[] = "Host: {$host}";
$request[] = "User-Agent: {$upagent}";
$request[] = 'Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1';
$request[] = 'Accept-Language: en-US,en;q=0.9';
$request[] = 'Accept-Charset: utf-8,windows-1251;q=0.7,*;q=0.7';
if (!empty($referer)) {
$request[] = "Referer: {$referer}";
}
if (!empty($cookies)) {
$request[] = "Cookie: {$cookies}";
}
if (!empty($pauth)) {
$request[] = "Proxy-Authorization: Basic {$pauth}";
}
$request[] = "X-File-Name: {$filename}";
$request[] = "X-File-Size: {$fileSize}";
$request[] = "Origin: {$origin}";
$request[] = 'Content-Disposition: attachment';
$request[] = 'Content-Type: multipart/form-data';
$request[] = "Content-Length: {$fileSize}";
$request[] = 'Connection: Close';
$request = implode($nn, $request) . $nn . $nn;
$errno = 0;
$errstr = '';
$hosts = (!empty($proxyHost) ? $scheme . $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
$fp = @stream_socket_client($hosts, $errno, $errstr, 120, STREAM_CLIENT_CONNECT);
if (!$fp) {
if (!function_exists('stream_socket_client')) {
html_error('[ERROR] stream_socket_client() is disabled.');
}
$dis_host = !empty($proxyHost) ? $proxyHost : $host;
$dis_port = !empty($proxyPort) ? $proxyPort : $port;
html_error(sprintf(lang(88), $dis_host, $dis_port));
}
if ($errno || $errstr) {
$lastError = $errstr;
return false;
}
if ($proxy) {
echo '<p>' . sprintf(lang(89), $proxyHost, $proxyPort) . '<br />PUT: <b>' . htmlspecialchars($url) . "</b>...<br />\n";
} else {
echo '<p>' . sprintf(lang(90), $host, $port) . '</p>';
}
echo lang(104) . ' <b>' . htmlspecialchars($filename) . '</b>, ' . lang(56) . ' <b>' . bytesToKbOrMbOrGb($fileSize) . '</b>...<br />';
$GLOBALS['id'] = md5(time() * rand(0, 10));
require TEMPLATE_DIR . '/uploadui.php';
flush();
$timeStart = microtime(true);
$chunkSize = GetChunkSize($fileSize);
fwrite($fp, $request);
fflush($fp);
$fs = fopen($file, 'r');
$totalsend = $time = $lastChunkTime = 0;
while (!feof($fs) && !$errno && !$errstr) {
$data = fread($fs, $chunkSize);
if ($data === false) {
//.........这里部分代码省略.........
示例14: empty
}
$imgurl = empty($imgurl[1]) ? 'http://rapidgator.net' . $imgurl[0] : $imgurl[0];
//Download captcha img.
$capt_page = cURL($imgurl, $cookie, 0, $referer);
$capt_img = substr($capt_page, strpos($capt_page, "\r\n\r\n") + 4);
$imgfile = DOWNLOAD_DIR . 'rapidgator_captcha.png';
if (file_exists($imgfile)) {
unlink($imgfile);
}
if (!write_file($imgfile, $capt_img)) {
html_error('Error getting CAPTCHA image.');
}
unset($capt_page, $capt_img);
$data = array();
$data['step'] = '1';
$data['cookie'] = urlencode(encrypt(CookiesToStr($cookie)));
$data['action'] = 'FORM';
// I should add 'premium_acc' to DefaultParamArr()
if (!$default_acc) {
$data['A_encrypted'] = 'true';
$data['up_login'] = urlencode(encrypt($_REQUEST['up_login']));
// encrypt() will keep this safe.
$data['up_pass'] = urlencode(encrypt($_REQUEST['up_pass']));
// And this too.
}
EnterCaptcha($imgfile . '?' . time(), $data);
exit;
}
//is_present($page, 'The code from a picture does not coincide', 'Login Failed: Captcha... (T8: I will add it later)');
is_present($page, 'The code from a picture does not coincide', 'Login Failed: Captcha... (T8: I will add it later)');
if (empty($cookie['user__'])) {
示例15: Login
private function Login($user, $pass)
{
$purl = 'http://' . $this->domain . '/';
$post = array();
$post['LoginForm%5Busername%5D'] = urlencode($user);
$post['LoginForm%5Bpassword%5D'] = urlencode($pass);
$post['LoginForm%5BrememberMe%5D'] = 1;
$post['yt0'] = 'Submit';
if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) {
$page = $this->GetPage($purl . 'login.html', $this->cookie, $post, $purl);
$this->cookie = GetCookiesArr($page, $this->cookie);
if (stripos($page, 'The verification code is incorrect.') !== false) {
$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
$data['premium_acc'] = 'on';
if ($this->pA) {
$data['pA_encrypted'] = 'true';
$data['premium_user'] = urlencode(encrypt($user));
// encrypt() will keep this safe.
$data['premium_pass'] = urlencode(encrypt($pass));
// And this too.
}
if (preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w\\.\\-]+)@i', $page, $cpid)) {
$data['step'] = '1';
$this->reCAPTCHA($pid[1], $data, 0, 'Login');
} elseif (preg_match('@\\W(auth/captcha\\.html\\?v=\\w+)@i', $page, $cpid)) {
$data['step'] = '2';
list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($purl . $cpid[1], $this->cookie), 2);
if (substr($headers, 9, 3) != '200') {
html_error('Error downloading captcha img.');
}
$mimetype = preg_match('@image/[\\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png';
$this->EnterCaptcha("data:{$mimetype};base64," . base64_encode($imgBody), $data, 20);
} else {
html_error('Login CAPTCHA not found.');
}
exit;
}
is_present($page, 'Incorrect username or password', 'Login Failed: Email/Password incorrect.');
is_present($page, 'You logged in from different country IP', 'Login Failed: Your account was locked for security reasons, to unlock your account check your email.');
if (empty($this->cookie['c903aeaf0da94d1b365099298d28f38f'])) {
html_error('Login Cookie Not Found.');
}
$page = $this->GetPage($purl, $this->cookie, 0, $purl . 'login.html');
is_notpresent($page, '/auth/logout.html">Logout', 'Login Error.');
$this->SaveCookies($user, $pass);
// Update cookies file
is_present($page, ' class="free">Free</', 'Account isn\'t premium');
return $this->PremiumDL();
}
if ($_POST['step'] == '1') {
if (empty($_POST['recaptcha_response_field'])) {
html_error('You didn\'t enter the image verification code.');
}
$post['LoginForm%5BverifyCode%5D'] = '';
$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
} else {
if (empty($_POST['captcha'])) {
html_error('You didn\'t enter the image verification code.');
}
$post['LoginForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
}
$_POST['step'] = false;
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
$page = $this->GetPage($purl . 'login.html', $this->cookie, $post, $purl);
$this->cookie = GetCookiesArr($page, $this->cookie);
is_present($page, 'The verification code is incorrect.');
is_present($page, 'Incorrect username or password', 'Login Failed: Email/Password incorrect.');
is_present($page, 'You logged in from different country IP', 'Login Failed: Your account was locked for security reasons, to unlock your account check your email');
if (empty($this->cookie['c903aeaf0da94d1b365099298d28f38f'])) {
html_error('Login Cookie Not Found');
}
$page = $this->GetPage($purl, $this->cookie, 0, $purl . 'login.html');
is_notpresent($page, '/auth/logout.html">Logout', 'Login Error.');
$this->SaveCookies($user, $pass);
// Update cookies file
is_present($page, ' class="free">Free</', 'Account isn\'t premium');
return $this->PremiumDL();
}