From e40d33a9a35e89bbc5d445b071e2bad1e59dcef5 Mon Sep 17 00:00:00 2001 From: "Mikhail Andreev (adw0rd)" Date: Sat, 21 Aug 2021 11:13:32 +0200 Subject: [PATCH] Added Client.account_security_info --- instagrapi/mixins/account.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/instagrapi/mixins/account.py b/instagrapi/mixins/account.py index 69449a59..41c9898a 100644 --- a/instagrapi/mixins/account.py +++ b/instagrapi/mixins/account.py @@ -57,6 +57,31 @@ def account_info(self) -> Account: result = self.private_request("accounts/current_user/?edit=true") return extract_account(result["user"]) + def account_security_info(self) -> dict: + """ + Fetch your account security info + + Returns + ------- + dict + Contains useful information on security settings: { + "is_phone_confirmed": true, + "is_two_factor_enabled": false, + "is_totp_two_factor_enabled": true, + "is_trusted_notifications_enabled": true, + "is_eligible_for_whatsapp_two_factor": true, + "is_whatsapp_two_factor_enabled": false, + "backup_codes": [...], + "trusted_devices": [], + "has_reachable_email": true, + "eligible_for_trusted_notifications": true, + "is_eligible_for_multiple_totp": false, + "totp_seeds": [], + "can_add_additional_totp_seed": false + } + """ + return self.private_request("accounts/account_security_info/", self.with_default_data({})) + def account_edit(self, **data: Dict) -> Account: """ Edit your profile (authorized account)