Skip to content

Commit 9324465

Browse files
committed
Fix auth
1 parent 8fad377 commit 9324465

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

vk_api/vk_api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ def vk_login(self, captcha_sid=None, captcha_key=None):
134134
response = self.http.get('https://vk.com/')
135135

136136
values = {
137-
'act': 'login',
137+
'role': 'al_frame',
138+
'_origin': 'https://vk.com',
138139
'utf8': '1',
139140
'email': self.login,
140141
'pass': self.password,
@@ -147,7 +148,7 @@ def vk_login(self, captcha_sid=None, captcha_key=None):
147148
'captcha_key': captcha_key
148149
})
149150

150-
response = self.http.post('https://login.vk.com/', values)
151+
response = self.http.post('https://login.vk.com/?act=login', values)
151152

152153
remixsid = None
153154

@@ -181,7 +182,7 @@ def vk_login(self, captcha_sid=None, captcha_key=None):
181182
return self.error_handlers[CAPTCHA_ERROR_CODE](captcha)
182183
else:
183184
raise AuthorizationError('Authorization error (capcha)')
184-
elif 'm=1' in response.url:
185+
elif 'onLoginFailed(4' in response.text:
185186
raise BadPassword('Bad password')
186187
else:
187188
raise AuthorizationError('Unknown error. Please send bugreport.')

0 commit comments

Comments
 (0)