login at youtube using cURL and php ?

Reply

Join Date: Jun 2009
Posts: 8
Reputation: phpboy is an unknown quantity at this point 
Solved Threads: 0
phpboy's Avatar
phpboy phpboy is offline Offline
Newbie Poster

login at youtube using cURL and php ?

 
0
  #1
Sep 5th, 2009
Hello. I'm quite a newbie to cURL and php. I have been trying hard to login at youtube using cURL but haven't had any success.

All i get in return when i run the following code is the youtube login page, with my username(which i used in the code) written at the username Field and it doesn't login.

Can anyone tell me what's goin on ?

  1. <?php
  2.  
  3. $posturl = '&GALX=obiRBhLUBIa&Email=myfancyusername@gmail.com&Passwd=myfancypassword&rmShown=1&signIn=Sign+in&asts=';
  4.  
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieYoutube");
  7. curl_setopt($ch, CURLOPT_URL,"https://www.google.com/accounts/ServiceLogin?service=youtube");
  8. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
  9. curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded"));
  10. curl_setopt($ch, CURLOPT_POST, 1);
  11. curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieYoutube");
  12. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false );
  13. curl_setopt($ch, CURLOPT_REFERER,"https://www.google.com/accounts/ServiceLogin?service=youtube");
  14. curl_setopt($ch, CURLOPT_POSTFIELDS, $posturl);
  15.  
  16.  
  17. $output = curl_exec ($ch);
  18.  
  19. curl_close($ch);
  20.  
  21. echo $output;
  22.  
  23. ?>
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 8
Reputation: phpboy is an unknown quantity at this point 
Solved Threads: 0
phpboy's Avatar
phpboy phpboy is offline Offline
Newbie Poster

Re: login at youtube using cURL and php ?

 
0
  #2
Sep 7th, 2009
can someone at least tell me if it's possible or not ?
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 4
Reputation: thisara is an unknown quantity at this point 
Solved Threads: 0
thisara thisara is offline Offline
Newbie Poster

Re: login at youtube using cURL and php ?

 
0
  #3
Sep 24th, 2009
I have made an app to login to youtube in VB and it worked fine.

Instead of ServiceLogin, use ServiceLoginAuth

should work. Could you come to expertcore org to discuss on this?
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,081
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: login at youtube using cURL and php ?

 
0
  #4
Sep 25th, 2009
Originally Posted by phpboy View Post
can someone at least tell me if it's possible or not ?
You should be able to if you send the right HTTP request. Since the login page is under HTTPS, observing the HTTP request is not straight forward.

What are you using to look at the HTTP request, if any? Or are you just creating the request based on the login form?
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Reply

Tags
curl, login, php, youtube

Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC