fbchat-dev / fbchat

Facebook Chat (Messenger) for Python
https://fbchat.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.19k stars 412 forks source link

Can't login it. #176

Closed MatejMecka closed 7 years ago

MatejMecka commented 7 years ago

I'm using the latest version of FB chat using the Python REPL and I cannot log in. I'm entering the email and password correctly and I checked. I'm using the default example in the documentations but whenever I try this happens:

>>> client = Client('email, 'pass')
Logging in...
Attempt #1 failed, retrying
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/fbchat/client.py", line 89, in __init__
    if not self.login():
  File "/Library/Python/2.7/site-packages/fbchat/client.py", line 164, in login
    self.payloadDefault['__rev'] = int(r.text.split('"revision":',1)[1].split(",",1)[0])
IndexError: list index out of range
>>> 

Edit: 2FA is disabled and i'm not accepted via Email or Password. Scraping Error?

madsmtm commented 7 years ago

I'm positive that you're not using the latest version of fbchat: The line self.payloadDefault['__rev'] = int(r.text.split('"revision":',1)[1].split(",",1)[0]) doesn't exist anymore, and this problem has been fixed in earlier versions. How did you install fbchat, and if you did it via. pip, did you make sure you installed/upgraded fbchat for the correct version?

MatejMecka commented 7 years ago

I'm a moron. I should reinstall my OS.