function nxs_CptCheckGP($o) { session_id("nxs-temp-gpcpt"); session_start(); $sess = unserialize($_SESSION['nxs-temp-gpcpt']); if (!empty($_POST['c'])) { $ck = $sess['c']; $flds = $sess['f']; $flds['recaptcha_response_field'] = $_POST['c']; $liObj = new nxsAPI_GP(); $hdrsArr = $liObj->headers('https://www.youtube.com/', 'https://www.youtube.com', 'POST', false); $advSet = array('headers' => $hdrsArr, 'httpversion' => '1.1', 'timeout' => 45, 'redirection' => 0, 'cookies' => $ck, 'body' => $flds); prr($advSet); $rep = nxs_remote_post('https://www.youtube.com/das_captcha', $advSet); if (is_nxs_error($rep)) { $badOut = print_r($rep, true) . " - ERROR"; return $badOut; } $contents2 = $rep['body']; prr($rep); if (stripos($contents2, 'id="error-box"') !== false) { echo 'The verification code was invalid or has timed out. Please try again.'; die; } if (stripos($contents2, 'The verification code was invalid') !== false) { echo 'The verification code was invalid or has timed out. Please try again.'; die; } if ($rep['response']['code'] == '303' && !empty($rep['headers']['location'])) { echo "OK. You are In"; $hdrsArr = $liObj->headers('http://www.youtube.com', 'https://www.youtube.com'); $ck = $rep['cookies']; $advSet = array('headers' => $hdrsArr, 'httpversion' => '1.1', 'timeout' => 45, 'redirection' => 0, 'cookies' => $ck); // prr($advSet); $rep = nxs_remote_get($rep['headers']['location'], $advSet); prr($ck); if (is_nxs_error($rep)) { $badOut = print_r($rep, true) . " - ERROR"; return $badOut; } $ck = $rep['cookies']; } } }