Skip to content

Cannot login  #567

Description

@kdalanon-ninthwave

Logging fails with specific user. I am not using client.logout() in my code
The program works fine with other facebook accounts but it doesn't work on this one.

Code to reproduce

def getCredentials():

#Retrieves the values
with open('credentials.txt') as json_file:
	data = json.load(json_file)
	for p in data['credentials']:
		email = p['email']
		password = p['password']
		message = p['message']
return email,password,message

credentials = getCredentials()
message = credentials[2]
client = Client(credentials[0], credentials[1])

Traceback

Attempt #4 failed, retrying
Traceback (most recent call last):
  File "C:\Users\kdalanon\AppData\Local\Programs\Python\Python38\lib\site-packages\fbchat\_client.py", line 205, in login
    self._state = State.login(
  File "C:\Users\kdalanon\AppData\Local\Programs\Python\Python38\lib\site-packages\fbchat\_state.py", line 149, in login
    return cls.from_session(session=session)
  File "C:\Users\kdalanon\AppData\Local\Programs\Python\Python38\lib\site-packages\fbchat\_state.py", line 186, in from_session
    fb_dtsg = FB_DTSG_REGEX.search(r.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
  File "fb.py", line 357, in <module>
    client = Client(credentials[0], credentials[1])
  File "C:\Users\kdalanon\AppData\Local\Programs\Python\Python38\lib\site-packages\fbchat\_client.py", line 103, in __init__
    self.login(email, password, max_tries, user_agent=user_agent)
  File "C:\Users\kdalanon\AppData\Local\Programs\Python\Python38\lib\site-packages\fbchat\_client.py", line 205, in login
    self._state = State.login(
  File "C:\Users\kdalanon\AppData\Local\Programs\Python\Python38\lib\site-packages\fbchat\_state.py", line 149, in login
    return cls.from_session(session=session)
  File "C:\Users\kdalanon\AppData\Local\Programs\Python\Python38\lib\site-packages\fbchat\_state.py", line 186, in from_session
    fb_dtsg = FB_DTSG_REGEX.search(r.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Environment information

  • Python version 3
  • fbchat version
  • If relevant, output from $ python -m pip list

If you have done any research, include that.
Make sure to redact all personal information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions