1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-10-03 22:07:11 +02:00

attempt to fix 2FA

This commit is contained in:
Alexander Graf 2023-10-16 08:44:40 +02:00
parent ac28a33b4d
commit 4022e7fae7

View File

@ -327,8 +327,15 @@ class InstaloaderContext:
raise InvalidArgumentException("No two-factor authentication pending.")
(session, user, two_factor_id) = self.two_factor_auth_pending
login = session.post('https://www.instagram.com/accounts/login/ajax/two_factor/',
data={'username': user, 'verificationCode': two_factor_code, 'identifier': two_factor_id},
login = session.post('https://www.instagram.com/api/v1/web/accounts/login/ajax/two_factor/',
data={
'identifier': two_factor_id,
'queryParams': '{"next":"/"}',
'trust_signal': 'true',
'username': user,
'verification_method': '1',
'verificationCode': two_factor_code,
},
allow_redirects=True)
resp_json = login.json()
if resp_json['status'] != 'ok':