Hello guys and girls of DP, I am trying to link a gmail account and youtube account with cURL and php. Process is like this: 1. Go to LINK and sign in with gmail [This I can do ] LINK = "https://www.google.com/accounts/ServiceLogin?service=youtube&continue=http://www.youtube.com/signup&passive=true" Code: <?php $email = 'ksandray29'; // without @gmail.com just username $pass= '29sandray'; $post_data='continue=http%3A%2F%2Fwww.youtube.com%2Fsignup&service=youtube&Email='.$email.'&Passwd='.$pass.'&rmShown=1&signIn=Sign+in&asts='; $cookie = 'tmp/yt-cookie.txt'; $url = 'https://www.google.com/accounts/ServiceLoginAuth?service=youtube'; $referer = 'https://www.google.com/accounts/ServiceLogin?service=youtube&continue=http://www.youtube.com/signup&passive=true'; $agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_MAXREDIRS, 5); curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec ($ch); curl_close ($ch); Code (markup): 2. Then after some redirects, I arrive to a page where I have to sign in with youtube account. [This I can't do...] include("LIB_parse.php"); $parsed_title = return_between($result, "<title>", "</title>", EXCL); echo $parsed_title; ?> Code (markup): When I try to parse the image between '<title>' and '</title>' I get the message "Redirecting", so I don't "arrive" to the youtube sign in page.. :/ Any help will be appreaciated from the bottom of my heart Or I can also give a couple of domain or pay for your hosting or pay some cash. This would be the code I would use once I get to the Youtube Sign In page: include("LIB_parse.php"); $parsed_auth = return_between($result, "&auth=", "\">", EXCL); $url = 'http://www.youtube.com/signup?auth='.$parsed_auth; $referer= 'http://www.youtube.com/signup?auth='.$parsed_auth; $cookie = 'tmp/yt-cookie.txt'; $agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)'; $gmail_user = 'sandray29'; $yt_user = 'sandray29'; $yt_pass = '29sandray'; $parsed_gcred = return_between($result, '<input type="hidden" name="gcred" value="', '" />', EXCL); $parsed_gtok = return_between($result, "<input type=\"hidden\" name=\"gtok\" value=\"", "\" />", EXCL); $parsed_session_token = return_between($result, "session_token=", "';", EXCL); $post_data = 'current_form=loginForm&gcred='.$parsed_gcred.'>ok='.$parsed_gtok.'&gemail='.$gmail_user.'%40gmail.com&username='.$yt_user.'&password='.$yt_pass.'&action_login=Log+In&session_token='.$parsed_session_token; $sh = curl_init(); curl_setopt($sh, CURLOPT_URL, $url); curl_setopt($sh, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($sh, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($sh, CURLOPT_MAXREDIRS, 10); curl_setopt($sh, CURLOPT_REFERER, $referer); curl_setopt($sh, CURLOPT_USERAGENT, $agent); curl_setopt($sh, CURLOPT_COOKIEFILE, $cookie); curl_setopt($sh, CURLOPT_COOKIEJAR, $cookie); curl_setopt($sh, CURLOPT_POST, 1); curl_setopt($sh, CURLOPT_POSTFIELDS, $post_data); $resultado= curl_exec ($sh); curl_close ($sh); echo $resultado; ?> Code (markup):
hi, what i want to do is link gmail and youtube account. In here: http://www.google.com/support/youtube/bin/answer.py?hl=en&answer=69964 They give a link to sign in with gmail then you are redirected like 3 times and then you have to sign in with youtube account. After that gmail is linked to youtube account. Anybody can make the script work, I will pay for it with paypal.