function getFormFields($data) { $inputs = getInputs($matches[1]); return $inputs; } else { } } $ch = curl_init(); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, $COOKIEFILE); curl_setopt($ch, CURLOPT_COOKIEFILE, $COOKIEFILE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_URL, 'https://accounts.google.com/ServiceLogin?service=youtube&uilel=3&hl=pl&continue=https%3A%2F%2Fwww.youtube.com'); $data = curl_exec($ch); $formFields = getFormFields($data); $formFields['identifier'] = $USERNAME; $formFields['password'] = $PASSWORD; $post_string = http_build_query($formFields); curl_setopt($ch, CURLOPT_URL, 'https://accounts.google.com/ServiceLoginAuth'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
Ma ktoś pomysł jak to rozwiązać?