Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Log in #660

Open
CaptainCaramel opened this issue Feb 24, 2022 · 8 comments
Open

Can't Log in #660

CaptainCaramel opened this issue Feb 24, 2022 · 8 comments

Comments

@CaptainCaramel
Copy link

I'm trying to log in, but I can't
The code is:
from fbchat import Client
from fbchat.models import *
if not client.isLoggedIn():
client = Client('PHONE', 'PASS')

The Traceback:
Logging in PHONE NUMBER...
Attempt #1 failed, retrying
Traceback (most recent call last):
File "C:\Users\MemeB\AppData\Local\Programs\Python\Python310\lib\site-packages\fbchat_client.py", line 205, in login
self._state = State.login(
File "C:\Users\MemeB\AppData\Local\Programs\Python\Python310\lib\site-packages\fbchat_state.py", line 151, in login
return cls.from_session(session=session)
File "C:\Users\MemeB\AppData\Local\Programs\Python\Python310\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
( then it retries 3 more times )
IndexError: list index out of range
Traceback (most recent call last):
File "O:\P\Messenger_script.py", line 3, in
client = Client('PHONENUMBER', 'PASSWORD')
File "C:\Users\MemeB\AppData\Local\Programs\Python\Python310\lib\site-packages\fbchat_client.py", line 103, in init
self.login(email, password, max_tries, user_agent=user_agent)
File "C:\Users\MemeB\AppData\Local\Programs\Python\Python310\lib\site-packages\fbchat_client.py", line 205, in login
self._state = State.login(
File "C:\Users\MemeB\AppData\Local\Programs\Python\Python310\lib\site-packages\fbchat_state.py", line 151, in login
return cls.from_session(session=session)
File "C:\Users\MemeB\AppData\Local\Programs\Python\Python310\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

Python 3.10.0
Fbchat 1.9.7

@minevsve
Copy link

minevsve commented Apr 2, 2022

@CaptainCaramel from what I see , Facebook (Meta) change a lot of stuff constantly and in the README which is displayed under the project it says that this library is no longer supported.

I saw that they utilize the m.facebook in order to login etc. if you manually go and try to open from your PC browser the part with messenger you are introduced to an error. The idea is that when you open mobile version from phone it will redirect to messenger app.

I dont think that this library can be reworked to work with messenger web-page , but if you or any other interested person has the needed knowledge , please help the community and re-work the logic.

@minevsve
Copy link

minevsve commented Apr 2, 2022

@CaptainCaramel i saw this thread #656 , installed python3.7 and changed the value and everything works for me. Maybe something changed in latest python3.10 so just do that and you can use it

@NoahOsmonth
Copy link

image

Try changing revision to 1
_state.py

@DavF27
Copy link

DavF27 commented May 10, 2022

Hello,

I did what you say @minevsve and @NoahOsmont but I have a similar issue:

File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_client.py", line 209, in login
user_agent=user_agent,
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_state.py", line 155, in login
"(Failed on url: {})".format(r.url)
fbchat._exception.FBchatUserError: Login failed. Check email/password. (Failed on url: https://m.facebook.com/login.php?login_attempt=1)
Attempt #2 failed, retrying
Traceback (most recent call last):
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_client.py", line 209, in login
user_agent=user_agent,
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_state.py", line 155, in login
"(Failed on url: {})".format(r.url)
fbchat._exception.FBchatUserError: Login failed. Check email/password. (Failed on url: https://m.facebook.com/login.php?login_attempt=1)
Attempt #3 failed, retrying
Traceback (most recent call last):
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_client.py", line 209, in login
user_agent=user_agent,
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_state.py", line 155, in login
"(Failed on url: {})".format(r.url)
fbchat._exception.FBchatUserError: Login failed. Check email/password. (Failed on url: https://m.facebook.com/login.php?login_attempt=1)
Attempt #4 failed, retrying
Traceback (most recent call last):
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_client.py", line 209, in login
user_agent=user_agent,
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_state.py", line 155, in login
"(Failed on url: {})".format(r.url)
fbchat._exception.FBchatUserError: Login failed. Check email/password. (Failed on url: https://m.facebook.com/login.php?login_attempt=1)
Traceback (most recent call last):
File "messenger_bot_sandra.py", line 13, in
client = Client(username, password)
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_client.py", line 103, in init
self.login(email, password, max_tries, user_agent=user_agent)
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_client.py", line 209, in login
user_agent=user_agent,
File "/Users/David/.pyenv/versions/3.7.13/lib/python3.7/site-packages/fbchat/_state.py", line 155, in login
"(Failed on url: {})".format(r.url)
fbchat._exception.FBchatUserError: Login failed. Check email/password. (Failed on url: https://m.facebook.com/login.php?login_attempt=1)

I ran this file with pyhton 3.7.13 (pyenv)

Do you have any idea of what can i do ?

thanks !

@AlizerUncaged
Copy link

@DavidFrancisco27 we have the same problem, have you fixed it? I believe facebook changed something in their end which probably hasnt been worked out in this library

@DavF27
Copy link

DavF27 commented Jun 8, 2022

Hi @AlizerUncaged, unfortunately I haven't fix this problem. I didn't look too much these days but at this point, I really want find a solution too..
The thing is, facebook and messenger are separate now. So I don't know if this code can still work even if we make some change on it.

@Gorol21
Copy link

Gorol21 commented Jul 25, 2022

Hello, i have this same issue, did somebody repair it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@DavF27 @Gorol21 @minevsve @AlizerUncaged @NoahOsmonth @CaptainCaramel and others