You're viewing a comment by Patrick Chan and its responses.

Patrick Chan Permalink
December 12, 2008, 09:45

I found the youtube login was changed so you might need to update the login sub as follows:

sub login {    my $resp = $ua->get($login_url);    unless ($resp->is_success) {        die "Failed getting $login_url: ", $resp->status_line;    }    my $session_token = extract_session_token($resp->content);	print "Session Token: $session_token\n";    unless (defined $session_token) {        die "Failed extracting session token, YouTube might have redesigned!";    }    # submit the login form    my $res = $ua->post($login_url,        {            current_form => 'loginForm',	    next         => '/',            username     => $opts{l},            password     => $opts{p},            action_login => 'Log In',	    session_token => $session_token        }    );    unless ($res->is_success) {        die "Failed logging in: failed submitting login form: ",            $res->status_line;    }    # We have no good way to check if we really logged in.    # I found that when you have logged in the upper right menu changes    # and you have access to 'Log Out' option.    # We check for this string to see if we have logged in.    unless ($res->content =~ /Sign Out/) {        die "Failed logging in: username/password incorrect";    }}

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.