Бывалый
Профиль
Группа: Участник
Сообщений: 244
Регистрация: 9.7.2006
Репутация: нет Всего: нет
|
Говорят нужно какие-то специальные данные вносить, вот вывод DataDumper'а: Код | '_request' => bless( { '_headers' => bless( { '::std_case' => { 'cookie2' => 'Cookie2', 'if-ssl-cert-subject' => 'If-SSL-Cert-Subject', 'cookie' => 'Cookie' }, 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0', 'cookie2' => '$Version="1"', 'content-length' => 32, 'cookie' => 'remixlhk=3a386548142f42bbd9; remixlang=0', 'content-type' => 'application/x-www-form-urlencoded' }, 'HTTP::Headers' ), '_method' => 'POST', '_uri' => bless( do{\(my $o = 'https://vk.com/login')}, 'URI::https' ), '_content' => 'email=%2B79520821519&pass=123Qwe', '_uri_canonical' => $VAR1->{'_request'}{'_uri'} }, 'HTTP::Request' ), '_headers' => bless( { '::std_case' => { 'x-powered-by' => 'X-Powered-By', 'title' => 'Title', 'client-ssl-socket-class' => 'Client-SSL-Socket-Class', 'x-meta-msapplication-packagefamilyname' => 'X-Meta-MsApplication-PackageFamilyName', 'x-ua-compatible' => 'X-UA-Compatible', 'x-meta-description' => 'X-Meta-Description', 'strict-transport-security' => 'Strict-Transport-Security', 'client-ssl-cert-subject' => 'Client-SSL-Cert-Subject', 'client-date' => 'Client-Date', 'refresh' => 'Refresh', 'x-frame-options' => 'X-Frame-Options', 'x-meta-msapplication-id' => 'X-Meta-MsApplication-ID', 'link' => 'Link', 'client-peer' => 'Client-Peer', 'client-response-num' => 'Client-Response-Num', 'client-ssl-cert-issuer' => 'Client-SSL-Cert-Issuer', 'set-cookie2' => 'Set-Cookie2', 'set-cookie' => 'Set-Cookie', 'client-ssl-cipher' => 'Client-SSL-Cipher' }, 'client-ssl-cipher' => 'ECDHE-RSA-AES256-GCM-SHA384', 'set-cookie' => 'remixtst=DELETED; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/; domain=.vk.com', 'pragma' => 'no-cache', 'connection' => 'close', 'content-length' => '17123', 'client-ssl-cert-issuer' => '/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2', 'date' => 'Sat, 08 Apr 2017 06:54:36 GMT', 'server' => 'Apache', 'client-peer' => '95.213.11.180:443', 'content-type' => 'text/html; charset=windows-1251', 'client-response-num' => 1, 'refresh' => '0; URL=/badbrowser.php', 'link' => [ '</images/icons/favicons/fav_logo.ico?5>; rel="shortcut icon"', '</images/safari_60.png?1>; rel="apple-touch-icon"', '</images/safari_76.png?1>; rel="apple-touch-icon"; sizes="76x76"', '</images/safari_120.png?1>; rel="apple-touch-icon"; sizes="120x120"', '</images/safari_152.png?1>; rel="apple-touch-icon"; sizes="152x152"', '</css/al/fonts_cnt.css?2889730895>; rel="stylesheet"; type="text/css"', '</css/al/common.css?25638623088>; rel="stylesheet"; type="text/css"', '</css/al/login.css?21504915349>; rel="stylesheet"; type="text/css"', '</css/al/ui_common.css?15138442166>; rel="stylesheet"; type="text/css"' ], 'x-meta-msapplication-id' => 'C6965DD5.VK', 'x-frame-options' => 'deny', 'client-ssl-cert-subject' => '/OU=Domain Control Validated/CN=*.vk.com', 'client-date' => 'Sat, 08 Apr 2017 06:54:39 GMT', 'x-ua-compatible' => 'IE=edge', 'x-meta-description' => '', 'strict-transport-security' => 'max-age=0', 'x-powered-by' => 'PHP/3.12434', 'client-ssl-socket-class' => 'IO::Socket::SSL', 'x-meta-msapplication-packagefamilyname' => 'C6965DD5.VK_v422avzh127ra', 'title' => '┬їюф | ┬╩юэЄръЄх', 'cache-control' => 'no-store' }, 'HTTP::Headers' ), '_rc' => '200' }, 'HTTP::Response' );
|
Сам скрипт на perl, каких данных не хватает? Код | use strict; use LWP::UserAgent; use HTTP::Cookies; use Encode qw(decode encode); use Data::Dumper; #use HTTP::Request::Common qw(GET POST); #use MIME::Base64 qw(encode_base64);
my $cookie_jar = HTTP::Cookies->new( file => 'lwp_cookies.txt', autosave => 1, ignore_discard => 1, );
my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 1 }, cookie_jar => $cookie_jar, ); #$ua->timeout(10); $ua->agent('Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0'); #my $response = $ua->post('https://vk.com/login', { email => '[email protected]', pass => 'pass' } )->as_string; my $response = $ua->post('https://vk.com/login', #https://login.vk.com/?act=login [ email => '[email protected]', pass => 'pass' ], );
print Dumper($response); if ($response->is_success) { #print $response->decoded_content; print encode("cp866", $response->decoded_content); print "1111\n"; } else { die $response->status_line; }
1;
|
|