Skip to content

Commit 9be7550

Browse files
committed
Check AccountBlocked by url
1 parent 85a3359 commit 9be7550

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

vk_api/vk_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ def vk_login(self, captcha_sid=None, captcha_key=None):
133133

134134
self.sid = remixsid
135135

136-
if 'id="login_blocked_wrap"' in response.text:
137-
raise AccountBlocked()
138-
139136
elif 'sid=' in response.url:
140137
captcha_sid = search_re(RE_CAPTCHAID, response.url)
141138
captcha = Captcha(self, captcha_sid, self.vk_login)
@@ -152,6 +149,9 @@ def vk_login(self, captcha_sid=None, captcha_key=None):
152149
if 'security_check' in response.url:
153150
self.security_check(response=response)
154151

152+
if 'act=blocked' in response.url:
153+
raise AccountBlocked()
154+
155155
def security_check(self, url=None, response=None):
156156
if url:
157157
response = self.http.get(url)

0 commit comments

Comments
 (0)