Open AdrienR17 opened 4 years ago
Go to this file
...\site-packages\fbchat\_state.py
Replace the following line
FB_DTSG_REGEX = re.compile(r'name="fb_dtsg" value="(.*?)"')
To this
FB_DTSG_REGEX = re.compile(r'"fb_dtsg","value":"(.*?)"')
Despite the modification, nothing changes, I got the same error
For me, that fixed the error, but it created a new one.
Traceback (most recent call last):
File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\site-packages\fbchat\_client.py", line 209, in login
user_agent=user_agent,
File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\site-packages\fbchat\_state.py", line 151, in login
return cls.from_session(session=session)
File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\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
Maybe its because you are using an unsupported browser. I got the same error, so I added a custom user-agent. This fixed the error for me
from fbchat import Client
ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
client = Client('<email>', '<password>', user_agent=ua)
Python\Python38-32\lib\site-packages\fbchat\_state.py", line 188, in from_session fb_dtsg = FB_DTSG_REGEX.search(r.text).group(1) AttributeError: 'NoneType' object has no attribute 'group'
Replace the following line
FB_DTSG_REGEX = re.compile(r'name="fb_dtsg" value="(.*?)"')
To this
FB_DTSG_REGEX = re.compile(r'"fb_dtsg","value":"(.*?)"')
i already do but the err still apear
I'm having the same issue as you @lolmc1982
prob solved here https://github.com/fbchat-dev/fbchat/issues/615
Thanks Abir, I'll check it out.
On Sun., Jan. 17, 2021, 19:07 Abir Ben Soltane, notifications@github.com wrote:
prob solved here
615 https://github.com/fbchat-dev/fbchat/issues/615
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fbchat-dev/fbchat/issues/619#issuecomment-761905118, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZIY3SKHH73QTHWZD6AYRLS2N3SLANCNFSM4S5TCM2Q .
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
Traceback
Environment information
fbchat 1.9.7