Added 2FA Support

Added new function _2FA.
Specified that two things that are definitely shown when 2FA is enabled
This commit is contained in:
Tim Chan
2017-04-04 20:17:13 +10:00
committed by GitHub
parent 83b5918a6d
commit fd6a3ab3e4

View File

@@ -231,11 +231,11 @@ class Client(object):
r = self._cleanPost(LoginURL, data)
# Usually, 'Checkpoint' will refer to 2FA
if 'checkpoint' in r.url:
if 'checkpoint' in r.url and 'Enter Security Code to Continue' in r.text:
r = self._2FA(r)
# Sometimes Facebook tries to show the user a "Save Device" dialog
if 'save-device' in r.url and 'Enter Security Code to Continue' in r.text:
if 'save-device' in r.url:
r = self._cleanGet(SaveDeviceURL)
if 'home' in r.url: