From 7413a643f635c968a87b188c696f27a37a2dd402 Mon Sep 17 00:00:00 2001 From: ekohilas Date: Wed, 27 Sep 2017 19:23:58 +1000 Subject: [PATCH 1/2] fixed 2FA bug --- fbchat/client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fbchat/client.py b/fbchat/client.py index 6552287..778849a 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -249,8 +249,9 @@ class Client(object): r = self._cleanPost(self.req_url.LOGIN, data) # Usually, 'Checkpoint' will refer to 2FA - if ('checkpoint' in r.url and - ('Enter Security Code to Continue' in r.text or 'Enter Login Code to Continue' in r.text)): + if ('checkpoint' in r.url + and ('enter security code to continue' in r.text.lower() + or 'enter login code to continue' in r.text.lower())): r = self._2FA(r) # Sometimes Facebook tries to show the user a "Save Device" dialog @@ -1541,7 +1542,7 @@ class Client(object): def on2FACode(self): """Called when a 2FA code is needed to progress""" - input('Please enter your 2FA code --> ') + return input('Please enter your 2FA code --> ') def onLoggedIn(self, email=None): """ From ee33e92bed0b11fad36f810bc4ab239107cf8ce5 Mon Sep 17 00:00:00 2001 From: ekohilas Date: Wed, 27 Sep 2017 19:24:35 +1000 Subject: [PATCH 2/2] added conditional enum34 2.7 requirement --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4fa392a..2f7a7df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ requests lxml beautifulsoup4 -enum34 +enum34; python_version == '2.7'