Skip to content

Commit 85a3359

Browse files
committed
Add vk_api.AccountBlocked exception
1 parent cd7fc60 commit 85a3359

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

vk_api/vk_api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ 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+
136139
elif 'sid=' in response.url:
137140
captcha_sid = search_re(RE_CAPTCHAID, response.url)
138141
captcha = Captcha(self, captcha_sid, self.vk_login)
@@ -388,6 +391,10 @@ class BadPassword(AuthorizationError):
388391
pass
389392

390393

394+
class AccountBlocked(AuthorizationError):
395+
pass
396+
397+
391398
class SecurityCheck(AuthorizationError):
392399

393400
def __init__(self, phone_prefix, phone_postfix, response=None):

0 commit comments

Comments
 (0)