Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14185

fbchat fails when trying to log in

$
0
0

this is my first time posting here. I'm trying to make a simple chatbot as a beginner project using fbchat but I can not get it to work. On facebook, I am getting notifications of successful logins to my account, but fbchat is failing. I have logged in from a browser on my computer to the facebook account I am using with the same ip, so facebook should not be blocking my log in attempts. Any help is appreciated.

Here is my python code:

from fbchat import Clientemail = 'email'password = 'password'client = Client(email, password)if client.isLoggedIn():    print("Logged in successfully!")else:    print("Login failed!")

Here is the console printout:

Attempt #1 failed, retryingTraceback (most recent call last):  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/fbchat/_client.py", line 205, in login    self._state = State.login(                  ^^^^^^^^^^^^  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/fbchat/_state.py", line 151, in login    return cls.from_session(session=session)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/fbchat/_state.py", line 190, in from_session    revision = int(r.text.split('"client_revision":', 1)[1].split(",", 1)[0])                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^IndexError: list index out of range

It keeps trying for 3 more tries with the same results.


Viewing all articles
Browse latest Browse all 14185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>