fbchat-dev / fbchat-dev/fbchat

Login Issue with FBChat

Open
#619 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.2k
Forks
403
PR merge metrics
No merged PRs in 30d

Description

## Description of the problem
Hello,
Trying to loggin with FBChat but I always have the following error despite on my FB account I've a notification that "someone try to connect". Could you help me please?

## Code to reproduce
```
username = "MY_EMAIL"
password = "MY_PASSWORD"
user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36'
client = fbchat.Client(username, password, user_agent=user_agent, max_tries = 1)

```

## Traceback
```
AttributeError Traceback (most recent call last)
in
6
7 user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36'
----> 8 client = fbchat.Client(username, password, user_agent=user_agent, max_tries = 1)

~\Anaconda3\lib\site-packages\fbchat\_client.py in __init__(self, email, password, user_agent, max_tries, session_cookies, logging_level)
101 or not self.isLoggedIn()
102 ):
--> 103 self.login(email, password, max_tries, user_agent=user_agent)
104
105 """

~\Anaconda3\lib\site-packages\fbchat\_client.py in login(self, email, password, max_tries, user_agent)
207 password,
208 on_2fa_callback=self.on2FACode,
--> 209 user_agent=user_agent,
210 )
211 self._uid = self._state.user_id

~\Anaconda3\lib\site-packages\fbchat\_state.py in login(cls, email, password, on_2fa_callback, user_agent)
149
150 if is_home(r.url):
--> 151 return cls.from_session(session=session)
152 else:
153 raise _exception.FBchatUserError(

~\Anaconda3\lib\site-packages\fbchat\_state.py in from_session(cls, session)
186 else:
187 # Fall back to searching with a regex
--> 188 fb_dtsg = FB_DTSG_REGEX.search(r.text).group(1)
189
190 revision = int(r.text.split('"client_revision":', 1)[1].split(",", 1)[0])

AttributeError: 'NoneType' object has no attribute 'group'
```

## Environment information
fbchat 1.9.7

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.