本文整理汇总了PHP中StrToCookies函数的典型用法代码示例。如果您正苦于以下问题:PHP StrToCookies函数的具体用法?PHP StrToCookies怎么用?PHP StrToCookies使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了StrToCookies函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Download
public function Download($link)
{
global $premium_acc;
$this->link = $link = str_ireplace('freakshare.net/', 'freakshare.com/', $link);
$this->cookie = array();
$this->DLRegexp = '@https?://\\w+\\.freakshare\\.com/get\\.php\\?dlid=\\w+@i';
$this->pA = empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true;
$_POST['step'] = empty($_POST['step']) ? false : $_POST['step'];
if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) {
$this->page = $this->GetPage($this->link, $this->cookie);
if (stripos($this->page, 'selected="selected">English<') === false) {
$this->cookie = GetCookiesArr($this->GetPage('http://freakshare.com/index.php?language=EN', $this->cookie), $this->cookie);
$this->page = $this->GetPage($this->link, $this->cookie);
}
is_present($this->page, 'This file does not exist!');
$this->cookie = GetCookiesArr($this->page, $this->cookie);
} elseif (!empty($_POST['cookie'])) {
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
}
if ($_REQUEST['premium_acc'] == 'on' && ($this->pA || !empty($premium_acc['freakshare_com']['user']) && !empty($premium_acc['freakshare_com']['pass']))) {
return $this->Login($this->pA ? $_REQUEST['premium_user'] : $premium_acc['freakshare_com']['user'], $this->pA ? $_REQUEST['premium_pass'] : $premium_acc['freakshare_com']['pass']);
} else {
return $this->FreeDL();
}
}
示例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: Download
public function Download($link)
{
$this->cookie = isset($_POST['yt_QS']) && !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array();
$url = parse_url($link);
$this->vid = array();
if (host_matches('youtu.be', $url['host'])) {
preg_match('@/([\\w\\-\\.]{11})@i', $url['path'], $this->vid);
} elseif (empty($url['query']) || ($this->vid[1] = cut_str('&' . $url['query'] . '&', '&v=', '&')) === false || !preg_match('@^[\\w\\-\\.]{11}$@i', $this->vid[1])) {
preg_match('@/(?:v|(?:embed))/([\\w\\-\\.]{11})@i', $url['path'], $this->vid);
}
if (empty($this->vid[1])) {
html_error('Video ID not found.');
}
$this->vid = $this->vid[1];
$this->link = 'https://www.youtube.com/watch?v=' . $this->vid;
$this->getFmtMaps();
$this->fmturlmaps = $this->GetVideosArr();
$yt_fmt = empty($_REQUEST['yt_fmt']) ? '' : $_REQUEST['yt_fmt'];
if (empty($yt_fmt) && !isset($_GET['audl'])) {
return $this->QSelector();
} elseif (isset($_REQUEST['ytube_mp4']) && $_REQUEST['ytube_mp4'] == 'on' && !empty($yt_fmt)) {
//look for and download the highest quality we can find?
if ($yt_fmt == 'highest') {
foreach ($this->fmts as $fmt) {
if (array_key_exists($fmt, $this->fmturlmaps)) {
$furl = $this->fmturlmaps[$fmt];
break;
}
}
} elseif (!($furl = $this->fmturlmaps[$yt_fmt])) {
html_error('Specified video format not found');
} else {
$fmt = $yt_fmt;
}
} else {
//just get the one Youtube plays by default (in some cases it could also be the highest quality format)
$fmt = key($this->fmturlmaps);
$furl = $this->fmturlmaps[$fmt];
}
$ext = '.flv';
$fmtexts = array('.mp4' => array(18, 22, 37, 38), '.webm' => array(43, 44, 45, 46), '.3gp' => array(36, 17));
foreach ($fmtexts as $k => $v) {
if (!is_array($v)) {
$v = array($v);
}
if (in_array($fmt, $v)) {
$ext = $k;
break;
}
}
if (empty($this->response['title'])) {
html_error('No video title found! Download halted.');
}
$FileName = str_replace(str_split('\\\\:*?"<>|=;' . "\t\r\n\f"), '_', html_entity_decode(trim($this->response['title']), ENT_QUOTES));
if (!empty($_REQUEST['cleanname'])) {
$FileName = preg_replace('@[^ A-Za-z_\\-\\d\\.,\\(\\)\\[\\]\\{\\}&\\!\'\\@\\%\\#]@u', '_', $FileName);
}
$FileName .= " [YT-f{$fmt}][{$this->vid}]{$ext}";
$this->RedirectDownload($furl, $FileName, $this->cookie, 0, 0, $FileName);
}
示例4: DownloadFree
private function DownloadFree($link)
{
$captcha = $_POST['captcha'];
$challenge = $_POST['challenge'];
$link = urldecode($_POST['link']);
$cookie = StrToCookies(urldecode($_POST['cookie']));
$page = $this->GetPage("{$link}?type=recaptcha&challenge={$challenge}&capture={$captcha}", $cookie, 0, $link, 0, 1);
$cookie = GetCookiesArr($page, $cookie);
if (preg_match('@\\{"(\\w+)":(\\w+)?,?"?(\\w+)?"?:?"([^"]+)"\\}@', $page, $ck)) {
if ($ck[1] == 'ok') {
switch ($ck[3]) {
case 'href':
$Url = $link . $ck[4];
$page = $this->GetPage($Url, $cookie, 0, $link);
if (!preg_match('@http:\\/\\/guest\\d+\\.extabit\\.com\\/[^"]+@', $page, $dl)) {
html_error("Error[DownloadLink - FREE] not found!");
}
$dlink = trim($dl[0]);
$filename = basename(parse_url($dlink, PHP_URL_PATH));
$this->RedirectDownload($dlink, $filename, $cookie, 0, $link);
break;
}
}
is_present($ck[1], 'err', $ck[4]);
}
}
示例5: DownloadFree
private function DownloadFree()
{
$recap = $_POST['recap'];
$captcha = $_POST['recaptcha_response_field'];
$challenge = $_POST['recaptcha_challenge_field'];
$this->link = urldecode($_POST['link']);
$this->cookie = StrToCookies(urldecode($_POST['cookie']));
$page = $this->GetPage("{$this->link}?type=recaptcha&challenge={$challenge}&capture={$captcha}", $this->cookie, 0, $this->link, 0, 1);
$this->cookie = GetCookiesArr($page, $this->cookie);
if (preg_match('@\\{"(\\w+)":(\\w+)?,?"?(\\w+)?"?:?"([^"]+)"\\}@', $page, $ck)) {
switch ($ck[1]) {
case 'ok':
$Url = $this->link . $ck[4];
$page = $this->GetPage($Url, $this->cookie, 0, $this->link);
if (!preg_match('/https?:\\/\\/guest\\d+\\.extabit\\.com\\/[^\\r\\n\\s\\t"]+/', $page, $dl)) {
html_error("Error[DownloadLink - FREE] not found!");
}
$dlink = trim($dl[0]);
$filename = basename(parse_url($dlink, PHP_URL_PATH));
$this->RedirectDownload($dlink, $filename, $cookie, 0, $this->link);
break;
case 'err':
echo "<center><font color='red'><b>{$ck['4']}</b></font></center>";
$data = $this->DefaultParamArr($this->link, $this->cookie);
$data['step'] = '1';
$data['recap'] = $recap;
$this->Show_reCaptcha($recap, $data);
break;
}
is_present($ck[1], 'err', $ck[4]);
}
}
示例6: DownloadFree
private function DownloadFree($link)
{
global $Referer;
if ($_REQUEST['step'] == 'captcha') {
$post["recaptcha_challenge_field"] = $_POST['recaptcha_challenge_field'];
$post["recaptcha_response_field"] = $_POST['recaptcha_response_field'];
$post["id"] = $_POST['id'];
$cookie = urldecode($_POST['cookie']);
$dlink = urldecode($_POST['link']);
$FileName = $_POST['name'];
$this->RedirectDownload($dlink, $FileName, $cookie, $post, $Referer);
exit;
} elseif ($_REQUEST['step'] == 'countdown') {
$link = urldecode($_POST['link']);
$cookie = StrToCookies(urldecode($_POST['cookie']));
$page = $this->GetPage($link, $cookie, 0, $Referer);
} else {
$page = $this->GetPage($link);
is_present($page, 'Requested file is deleted.');
is_present($page, 'There is another download in progress from your IP. Please try to downloading later.');
$cookie = GetCookiesArr($page);
$FileName = trim(str_replace(" ", ".", cut_str($page, 'Download ', ',')));
// first timer
if (preg_match('/wf = (\\d+);/', $page, $wait)) {
$this->CountDown($wait[1]);
}
if (preg_match("/u='(.+)'/", $page, $cap)) {
$link = "http://www.crocko.com{$cap['1']}";
}
$page = $this->GetPage($link, $cookie, 0, $Referer);
}
//get new timer, then refresh the page
if (preg_match("/w='(\\d+)'/", $page, $wait)) {
if ($wait[1] > 100) {
$data = $this->DefaultParamArr($link, $cookie);
$data['step'] = 'countdown';
$this->JSCountdown($wait[1], $data);
} else {
$this->CountDown($wait[1]);
$page = $this->GetPage($link, $cookie, 0, $Referer);
}
}
if (preg_match('%<form method="post" action="([^"]+)">%', $page, $dl)) {
$dlink = trim($dl[1]);
if (!is_array($cookie)) {
$cookie = StrToCookies($cookie, GetCookiesArr($page));
} else {
$cookie = GetCookiesArr($page, $cookie);
}
if (!preg_match('/Recaptcha\\.create\\("([^"]+)/i', $page, $cid)) {
html_error('Can\'t find chaptcha id');
}
$data = $this->DefaultParamArr($dlink, $cookie);
$data['step'] = 'captcha';
$data['id'] = cut_str($page, 'name="id" value="', '"');
$data['name'] = $FileName;
$this->Show_reCaptcha($cid[1], $data);
exit;
}
}
示例7: chkCaptcha
private function chkCaptcha()
{
if (stripos($this->page, 'Please complete the form below:') === false) {
return;
}
if (!empty($_POST['step']) && $_POST['step'] == '1') {
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']);
$this->page = $this->GetPage($this->link, $this->cookie, $post);
if (stripos($this->page, 'You entered an invalid captcha') !== false) {
echo "\n<span class='htmlerror'><b>You entered an invalid captcha, please try again.</b></span><br />";
unset($_POST['step']);
$this->chkCaptcha();
}
} else {
if (!preg_match('@https?://(?:[a-zA-Z\\d\\-]+\\.)*(?:google\\.com/recaptcha/api|recaptcha\\.net)/(?:challenge|noscript)\\?k=([\\w\\.\\-]+)@i', $this->page, $cpid)) {
html_error('reCaptcha Not Found.');
}
$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
$data['step'] = '1';
$this->reCAPTCHA($cpid[1], $data);
exit;
}
}
示例8: 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);
}
}
示例9: Free
private function Free()
{
if ($_REQUEST['step'] == '1') {
$this->link = urldecode($_POST['link']);
$this->cookie = StrToCookies(urldecode($_POST['cookie']));
$post = array();
foreach ($_POST["tmp"] as $k => $v) {
$post[$k] = $v;
}
$post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
$post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
$page = $this->GetPage($this->link, $this->cookie, $post, $this->link);
} else {
$form = cut_str($this->page, '<Form method="POST" action=\'\'>', '</Form>');
if (!preg_match_all('/<input type="hidden" name="([^"]+)" value="([^"]+)?">/', $form, $match)) {
html_error('Error[Post Data 1 - FREE not found!]');
}
$match = array_combine($match[1], $match[2]);
$post = array();
foreach ($match as $k => $v) {
$post[$k] = $v;
}
$post['x'] = rand(11, 70);
$post['y'] = rand(11, 20);
$page = $this->GetPage($this->link, $this->cookie, $post, $this->link);
}
if (stripos($page, 'Type the two words')) {
$form = cut_str($page, '<Form name="F1" method="POST" action=""', '</Form>');
if (stripos($form, 'Wrong captcha')) {
echo "<center><font color='red'><b>Wrong Captcha, Please Retry!</b></font></center>";
}
if (!preg_match_all('/<input type="hidden" name="([^"]+)" value="([^"]+)?">/', $form, $match)) {
html_error('Error[Post Data 2 - FREE not found!]');
}
$match = array_combine($match[1], $match[2]);
if (!preg_match('/\\/recaptcha\\/api\\/challenge\\?k=([^"]+)"/', $form, $c)) {
html_error('Error[Captcha data not found!]');
}
if (!preg_match('/(\\d+)<\\/span> seconds/', $form, $w)) {
html_error('Error[Timer not found!]');
}
$this->CountDown($w[1]);
$data = $this->DefaultParamArr($this->link, $this->cookie);
$data['step'] = '1';
foreach ($match as $k => $v) {
$data["tmp[{$k}]"] = $v;
}
$this->Show_reCaptcha($c[1], $data);
exit;
}
if (!preg_match('/Location: (https?:\\/\\/[^\\r\\n]+)/i', $page, $dl)) {
html_error('Error[Download Link - FREE not found!]');
}
$dlink = trim($dl[1]);
$filename = basename(parse_url($dlink, PHP_URL_PATH));
$this->RedirectDownload($dlink, $filename, $this->cookie, 0, $this->link);
exit;
}
示例10: 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');
}
示例11: AnonDL
private function AnonDL()
{
if (empty($_POST['step']) || $_POST['step'] != '1') {
$page = $this->GetPage($this->baseurl . '/download/start_timer/' . $this->fid, $this->cookie, 0, $this->link . "\r\nX-Requested-With: XMLHttpRequest");
$this->cookie = GetCookiesArr($page, $this->cookie);
$start_timer = $this->json2array($page, 'StartTimer Error');
if (empty($start_timer) || empty($start_timer['show_timer']) && empty($start_timer['redirect_url'])) {
if (!empty($start_timer['html'])) {
if (preg_match('@Delay between downloads must be not less than \\d+ minutes.\\s+Try again in \\d+ minutes@i', $page, $err)) {
html_error("[AnonDL] {$err[0]}");
}
html_error('Error @ StartTimer: ' . htmlspecialchars(strip_tags($start_timer['html']), ENT_QUOTES));
} else {
// if (substr($page, 9, 3) == '200')
textarea($start_timer);
html_error('Unknown error @ StartTimer');
}
}
if (strpos($start_timer['redirect_url'], '://') === false) {
$start_timer['redirect_url'] = $this->baseurl . $start_timer['redirect_url'];
}
if (!empty($start_timer['show_timer']) && $start_timer['timer'] > 0) {
$this->CountDown($start_timer['timer']);
}
$page = $this->GetPage($start_timer['redirect_url'], $this->cookie, 0, $this->link);
$this->cookie = GetCookiesArr($page, $this->cookie);
if (!preg_match('@https?://api(?:-secure)?\\.solvemedia\\.com/papi/challenge\\.(?:no)?script\\?k=([\\w\\-\\.]+)@i', $page, $smKey)) {
if (preg_match($this->DLRegexp, $page, $DL)) {
return $this->RedirectDownload($DL[0], urldecode(parse_url($DL[0], PHP_URL_PATH)));
}
html_error('CAPTCHA not found.');
}
$data = $this->DefaultParamArr($this->link, $this->cookie, $start_timer['redirect_url'], true);
$data['step'] = '1';
$data['posturl'] = urldecode(parse_url($start_timer['redirect_url'], PHP_URL_PATH));
return $this->SolveMedia($smKey[1], $data, $start_timer['redirect_url']);
} else {
$post = $this->verifySolveMedia();
$post['send'] = 'Submit';
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
$page = $this->GetPage($this->baseurl . $_POST['posturl'], $this->cookie, $post);
$this->cookie = GetCookiesArr($page, $this->cookie);
if (preg_match("@\nLocation: (?:https?://(?:www\\.)?alfafile\\.net)?/file/{$this->fid}/?\r?\n@i", $page)) {
$page = $this->GetPage($this->link, $this->cookie);
}
if (!preg_match($this->DLRegexp, $page, $DL)) {
html_error('Download Link Not Found.');
}
return $this->RedirectDownload($DL[0], urldecode(parse_url($DL[0], PHP_URL_PATH)));
}
}
示例12: FreeDL
private function FreeDL()
{
$pUrl = 'http://filesflash.com/freedownload.php';
if (!empty($_POST['step']) && $_POST['step'] == '1') {
if (!empty($_POST['cookie'])) {
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
}
if (empty($_POST['recaptcha_response_field'])) {
html_error('You didn\'t enter the image verification code.');
}
if (empty($_POST['recaptcha_challenge_field'])) {
html_error('Empty reCAPTCHA challenge.');
}
$post = array();
$post['token'] = $_POST['token'];
$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
$post['submit'] = 'Submit';
$page = $this->GetPage($pUrl, $this->cookie, $post);
is_present($page, 'Your IP address is already downloading another link.');
if (stripos($page, 'google.com/recaptcha/api/') !== false || stripos($page, 'recaptcha.net/') !== false) {
html_error('Wrong captcha entered.');
}
if (!preg_match($this->DLregexp, $page, $dlink)) {
html_error('Error: Download link not found.');
}
if (!preg_match('@\\scount\\s*=\\s*(\\d+)\\s*;@i', $page, $wait)) {
html_error('Error: Countdown not found.');
}
if ($wait[1] > 0) {
$this->CountDown($wait[1]);
}
return $this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH))), $this->cookie, 0, $pUrl);
}
$this->cookie = GetCookiesArr($this->page, $this->cookie);
$post = array();
$post['token'] = urlencode(cut_str($this->page, 'name="token" value="', '"')) or html_error('Download Token not Found.');
$post['freedl'] = urlencode(cut_str($this->page, 'name="freedl" value="', '"')) or $post['submit'] = '+Start+free+download+';
$page = $this->GetPage($pUrl, $this->cookie, $post);
is_present($page, 'Your IP address is already downloading another link.');
$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
$data['step'] = 1;
$data['token'] = $post['token'];
// Modified regexp
if (!preg_match('@https?://(?:[\\w\\-]+\\.)?(?:google\\.com/recaptcha/api|recaptcha\\.net)/(?:challenge|noscript)\\?(?:[^\'\\"<>&]+&(?:amp;)?)*k=([\\w\\.\\-]+)@i', $page, $reCaptcha)) {
html_error('reCAPTCHA not found.');
}
$this->reCAPTCHA($reCaptcha[1], $data);
exit;
}
示例13: 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);
}
示例14: MF_Captcha
private function MF_Captcha()
{
if (!empty($this->page) && stripos($this->page, ">Authorize Download</a>") === false) {
return;
}
if (!empty($_POST['step']) && $_POST['step'] == '1') {
$_POST['step'] = false;
if (empty($_POST['recaptcha2_response_field']) && empty($_POST['recaptcha_response_field']) && empty($_POST['adcopy_response'])) {
html_error('You didn\'t enter the image verification code.');
}
if (empty($_POST['adcopy_response'])) {
if (empty($_POST['recaptcha2_public_key'])) {
$post = array('recaptcha_challenge_field' => urlencode($_POST['recaptcha_challenge_field']), 'recaptcha_response_field' => urlencode($_POST['recaptcha_response_field']));
} else {
$post = $this->verifyReCaptchav2();
}
} else {
$post = $this->verifySolveMedia();
}
$this->cookie = StrToCookies(urldecode($_POST['cookie']));
$purl = 'http://www.mediafire.com/?' . $this->fid[3];
$this->page = $this->GetPage($purl, $this->cookie, $post);
$this->cookie = GetCookiesArr($this->page, $this->cookie);
is_present($this->page, 'Your entry was incorrect, please try again!');
$this->page = $this->GetPage($this->link, $this->cookie, 0, $purl);
$this->cookie = GetCookiesArr($this->page, $this->cookie);
is_present($this->page, 'Your entry was incorrect, please try again!.');
$this->MF_Captcha();
} else {
$data = $this->DefaultParamArr($this->link, $this->cookie);
$data['step'] = 1;
if (($pos = stripos($this->page, 'data-sitekey=')) !== false && preg_match('@data-sitekey=\\s*[\\"\']([\\w\\.\\-]+)[\\"\']@i', $this->page, $cKey, 0, $pos)) {
// reCAPTCHA v2
return $this->reCAPTCHAv2($cKey[1], $data);
} else {
if (($pos = stripos($this->page, '://api.solvemedia.com/')) !== false && preg_match('@https?://api\\.solvemedia\\.com/papi/challenge\\.(?:no)?script\\?k=([\\w\\.\\-]+)@i', $this->page, $cKey, 0, $pos)) {
// SolveMedia
return $this->SolveMedia($cKey[1], $data);
} else {
if (preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w\\.\\-]+)@i', $this->page, $cKey)) {
// Old reCAPTCHA
return $this->reCAPTCHA($cKey[1], $data);
}
}
}
html_error('Error: CAPTCHA not found.');
}
}
示例15: Download
public function Download($link)
{
$this->cookie = !empty($_POST['step']) && !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array('ff' => 'off');
if (!preg_match('@/video/(x[0-9a-zA-Z]+)@i', $link, $xid)) {
html_error('Video ID not found.');
}
$this->xid = $xid[1];
$this->link = 'http://www.dailymotion.com/video/' . $this->xid;
if (empty($_POST['step'])) {
$page = $this->GetPage($this->link, $this->cookie);
$this->cookie = GetCookiesArr($page, $this->cookie);
$status = (int) substr($page, 9, 3);
switch ($status) {
case 200:
break;
case 403:
html_error('This video is forbidden to download!');
break;
case 404:
html_error('404 Not Found');
break;
case 410:
html_error('This video has been removed by the user.');
break;
default:
html_error("Unexpected response: {$status}");
break;
}
}
$this->getVideoInfo();
if (empty($_POST['dlstream']) && !isset($_GET['audl'])) {
return $this->QSelector();
} elseif (empty($_POST['dlstream']) || !empty($this->streams[$_POST['dlstream']])) {
$key = empty($_POST['dlstream']) ? key($this->streams) : $_POST['dlstream'];
$DL = $this->streams[$key];
} else {
html_error('Selected video stream was not found.');
}
$filename = preg_replace('@[^ A-Za-z_\\-\\d\\.,\\(\\)\\[\\]\\{\\}&\\!\'\\@\\%\\#]@u', '_', trim($this->title), ENT_QUOTES);
$filename .= " [DM-{$key}p][{$this->xid}].mp4";
$page = $this->GetPage($DL, $this->cookie);
if (!preg_match('@https?://[^/\\s]+/video/[^\\s<>\'\\"]+@i', $page, $DL)) {
html_error('Download Link not Found.');
}
$this->RedirectDownload($DL[0], $filename, $this->cookie, 0, 0, $filename);
}