Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New login page vk.com #9841

Closed
VLZH opened this issue Jun 20, 2016 · 2 comments
Closed

New login page vk.com #9841

VLZH opened this issue Jun 20, 2016 · 2 comments
Labels

Comments

@VLZH
Copy link

@VLZH VLZH commented Jun 20, 2016

Meta info

  • youtube-dl version 2016.06.19.1
  • Python version 2.7.6 - Linux-2.6.32-openvz-042stab113.17-amd64-x86_64-with-Ubuntu-14.04-trusty

Vk.com testing a new login page. For some regions it has changed (below attached a screenshot). Now, the script does not pass authentication by returning a response:

Unable to login, incorrect username and / or password

The old page is located at the same address, if your region is included in the test list it will automatically redirect to https://www.new.vk.com

Open this page via a proxy server I could not, so I can give access to the ssh-tunnel work.

Last appearance: https://yadi.sk/d/kJxZ4yAkses8x
The new species: https://yadi.sk/d/TuIcQ4N3sesJi

@VLZH
Copy link
Author

@VLZH VLZH commented Jun 20, 2016

New Form:

<form method="POST" name="login" id="quick_login_form" action="https://login.vk.com/?act=login" target="quick_login_frame">
    <input type="hidden" name="act" value="login">
    <input type="hidden" name="role" value="al_frame">
    <input type="hidden" name="expire" id="quick_expire_input" value="">
    <input type="hidden" name="captcha_sid" id="quick_captcha_sid" value="">
    <input type="hidden" name="captcha_key" id="quick_captcha_key" value="">
    <input type="hidden" name="_origin" value="https://new.vk.com">
    <input type="hidden" name="ip_h" value="6376690c36ad3814dc">
    <input type="hidden" name="lg_h" value="f6be131573b30b7c11">
    <div class="label">Телефон или email</div>
    <div class="labeled"><input type="text" name="email" class="dark" id="quick_email"></div>
    <div class="label">Пароль</div>
    <div class="labeled"><input type="password" name="pass" class="dark" id="quick_pass" onkeyup="toggle('quick_expire', !!this.value);toggle('quick_forgot', !this.value)"></div>
    <input type="submit" class="submit">
  </form>
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 22, 2016

Basically, that is VK bug. They serve two same cookies in Set-Cookie header over HTTP/1.1 that confuse clients working over HTTP/1.1.

PS > curl.exe -v --http1.1 -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0' -o nul https://new.vk.com/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 87.240.165.85...
* Connected to new.vk.com (87.240.165.85) port 443 (#0)
...
<snip>
...
> GET / HTTP/1.1
> Host: new.vk.com
> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
> Accept: */*
>
{ [5 bytes data]
< HTTP/1.1 200 OK
< Server: Apache
< Date: Wed, 22 Jun 2016 20:14:35 GMT
< Content-Type: text/html; charset=windows-1251
< Content-Length: 24044
< Connection: keep-alive
< X-Powered-By: PHP/3.2271
< Set-Cookie: remixlang=0; expires=Fri, 30 Jun 2017 16:23:38 GMT; path=/; domain=.vk.com
< Set-Cookie: remixlhk=c8741f8b69fd7e1a41; expires=Sun, 25 Jun 2017 13:33:17 GMT; path=/; domain=.vk.com
< Set-Cookie: remixlhk=2292ab38697d9f90b1; expires=Sun, 25 Jun 2017 09:21:38 GMT; path=/; domain=.vk.com
< Pragma: no-cache
< Cache-control: no-store
< X-Frame-Options: deny
<
{ [3542 bytes data]
100 24044  100 24044    0     0  56976      0 --:--:-- --:--:-- --:--:-- 56976
* Connection #0 to host new.vk.com left intact

Namely:

< Set-Cookie: remixlhk=c8741f8b69fd7e1a41; expires=Sun, 25 Jun 2017 13:33:17 GMT; path=/; domain=.vk.com
< Set-Cookie: remixlhk=2292ab38697d9f90b1; expires=Sun, 25 Jun 2017 09:21:38 GMT; path=/; domain=.vk.com

VK expects the first one to be set (i.e. remixlhk=c8741f8b69fd7e1a41) but urllib picks up the second one remixlhk=2292ab38697d9f90b1 that looks correct according to RFC6265 [1].
As of [1, 11] the newer one cookie is considered rather that older one.

  1. http://tools.ietf.org/html/rfc6265#section-5.3
@dstftw dstftw closed this Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.