Youtube login with PHP (cURL)

Discussion in 'PHP' started by hilool, Aug 8, 2008.

  1. #1
    It was working fine before, but now youtube changed their API a bit and I've been trying to get it working all night with no luck at all.

    here's some of the code ->

    
    
    $loginURL = "http://youtube.com/signup";
    
    $loginFields = 
    "current_form=loginForm&next=/my_account&username=$user&password=pass&action_login=Log In&session_token=$token2";
    
    $logged2 = hitPage($loginURL, $loginFields);
    
    
    Code (markup):
    I used a function to find the token and printed it to make sure it got the right string, but still nothing..

    can someone help me figure this out, thanks in advance. :)
     
    hilool, Aug 8, 2008 IP
  2. Shoro

    Shoro Peon

    Messages:
    143
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I've had (very rare) cases with cURL where using an array for the postdata succeeded where using a string failed, even though as far as I could tell the data was the same. I doubt that's the problem in this case, but just putting it out there.
     
    Shoro, Aug 8, 2008 IP
  3. doridori

    doridori Banned

    Messages:
    473
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ugh...i would not recommend cURL at all for this kind of thing....i recommend Perl & WWW::Mechanize

    BUT

    try Snoopy.


    the dirty solution would be to use something like LiveHTTPHeaders to see the url being sent out.

    OR look at the html form, look for hidden fields in the submit form. yahoo has several to prevent you from using curl.
     
    doridori, Aug 8, 2008 IP
  4. hilool

    hilool Active Member

    Messages:
    161
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    That's the thing, I can't find the submit field for the Loginform, I tried wireshark to see the URL that is being sent out but it doesn't give me the whole url.
     
    hilool, Aug 9, 2008 IP
  5. hilool

    hilool Active Member

    Messages:
    161
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    nevermind, figured it out! Thanks.
     
    hilool, Aug 9, 2008 IP
  6. doridori

    doridori Banned

    Messages:
    473
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i'd recommend mech-dump
     
    doridori, Aug 10, 2008 IP
  7. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    mind sharing? i'm trying to get an video uploader via php for youtube working, but i need to 'login via google account' via php.
     
    szalinski, Aug 9, 2009 IP