From cb97a5813cccdceeefe7518b1acdc0f07a8dd66e Mon Sep 17 00:00:00 2001 From: python273 Date: Sat, 25 Jun 2022 17:41:10 +0300 Subject: [PATCH] Check 429 pass is successful --- vk_api/vk_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vk_api/vk_api.py b/vk_api/vk_api.py index e4344e4..91dc458 100644 --- a/vk_api/vk_api.py +++ b/vk_api/vk_api.py @@ -260,6 +260,8 @@ def _vk_login(self, captcha_sid=None, captcha_key=None): hash429_md5 = md5(self.http.cookies['hash429'].encode('ascii')).hexdigest() self.http.cookies.pop('hash429') response = self.http.get(f'{response.url}&key={hash429_md5}') + if not response.url.startswith('https://vk.com/login'): + raise AuthError('Could not pass 429.html') headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',