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

Facebook login "TypeError: 'NoneType' object is not subscriptable" #1

Closed Kozubi closed 8 years ago

Kozubi commented 9 years ago

Hello, After providing correct id/pass this exception occurs:

Traceback (most recent call last): File "<pyshell#10>", line 1, in cilent = fbchat.Client(login,pass) File "C:\Python34\lib\site-packages\fbchat\client.py", line 63, in init if not self.login(): File "C:\Python34\lib\site-packages\fbchat\client.py", line 106, in login self.fb_dtsg = soup.find("input", {'name':'fb_dtsg'})['value'] TypeError: 'NoneType' object is not subscriptable

Any ideas? Thanks!

bsansouci commented 9 years ago

Hey, I'm one of the authors of the nodejs version of this api. We recently had a problem where Facebook detected that someone logged in our bot account from a different location and blocked the account. Have you tried logging in simply from a browser to check?

Kozubi commented 9 years ago

Hey, yes I did that. Also tried with different account which I'm able to login with browser but when I try to use fbchat I get "Exception: id or password is wrong" Any ideas? So to make this clear: On one account I have "TypeError" exception On second "Exception: id or password is wrong" Thanks.

bsansouci commented 9 years ago

Mmmmh I'm not too sure. Try adding these two lines in client.py under line 92

f = open("index.html", "w")
f.write(r.text)

Then open the index.html file that it created. Maybe you'll have a clearer idea of what Facebook is trying to tell you.

carpedm20 commented 9 years ago

Actualy this library is still in early stage (Development Status :: 2 - Pre-Alpha). So, I would rather suggest you to wait for a while until the development status become more mature. Thanks!

wannaphong commented 9 years ago

Fix https://github.com/carpedm20/fbchat/pull/7