hh-ru-auto-resume-raising
hh-ru-auto-resume-raising copied to clipboard
Добавили капчу, теперь не работает login
Невозможно авторизоваться через метод login, так как теперь при входе требует капчу
Вероятное решение - использовать OTP при входе
async def login(self) -> bool:
await self._get_cookie_anonymous()
url = 'https://hh.ru/account/login'
headers, data = await self._get_request_data()
response = await self.request('post', url, headers=headers, data=data)
cookie = str(response.headers)
self.xsrf = re.search(r"(?<=_xsrf=).+?;", cookie).group()[:-1]
hhtoken = re.search(r"(?<=hhtoken=).+?;", cookie)
if hhtoken is not None:
self.hhtoken = hhtoken.group()[:-1]
data = dict(xsrf=self.xsrf, hhtoken=self.hhtoken)
async with aiofiles.open('config/tokens.json', 'w') as file:
await file.write(json.dumps(data))
return True
else:
return False