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

"IndexError: list index out of range" (can't connect to Facebook?) #7

Open
chrisbeckstrom opened this issue Oct 29, 2020 · 5 comments

Comments

@chrisbeckstrom
Copy link

I feel like I'm so close, but maybe missing some detail somewhere. I'd be grateful if anybody could shed some light on what I'm doing wrong here!

when I run python3 fbridge.py, here's what I get:

Logging in [email protected]...
Attempt #1 failed, retrying
Traceback (most recent call last):
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_client.py", line 209, in login
    user_agent=user_agent,
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_state.py", line 151, in login
    return cls.from_session(session=session)
  File "/home/chris/.local/lib/python3.5/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
Attempt #2 failed, retrying
Traceback (most recent call last):
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_client.py", line 209, in login
    user_agent=user_agent,
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_state.py", line 151, in login
    return cls.from_session(session=session)
  File "/home/chris/.local/lib/python3.5/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
Attempt #3 failed, retrying
Traceback (most recent call last):
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_client.py", line 209, in login
    user_agent=user_agent,
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_state.py", line 151, in login
    return cls.from_session(session=session)
  File "/home/chris/.local/lib/python3.5/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
Attempt #4 failed, retrying
Traceback (most recent call last):
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_client.py", line 209, in login
    user_agent=user_agent,
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_state.py", line 151, in login
    return cls.from_session(session=session)
  File "/home/chris/.local/lib/python3.5/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
Traceback (most recent call last):
  File "fbridge.py", line 100, in <module>
    client = FBListener(username, password)
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_client.py", line 103, in __init__
    self.login(email, password, max_tries, user_agent=user_agent)
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_client.py", line 209, in login
    user_agent=user_agent,
  File "/home/chris/.local/lib/python3.5/site-packages/fbchat/_state.py", line 151, in login
    return cls.from_session(session=session)
  File "/home/chris/.local/lib/python3.5/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

my matterbridge.toml:

[mattermost]
    [mattermost.work]
    UseTLS=true
    NoTLS=false
    Server="https://secret"
    Team="helloworld"
    Login="secretusername"
    Password="p355w0rd"
    PrefixMessagesWithNick=true
    RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[api.myapi]
BindAddress="127.0.0.1:4242"
Buffer=1000
RemoteNickFormat="{NICK}"


## This is the default FB gateway. All facebook measseages will be sendt here
[[gateway]]
name="FBgateway"
enable=true

[[gateway.inout]]
account="mattermost.work"
channel="hello"

[[gateway.inout]]
account="api.myapi"
channel="api"
@nileplumb
Copy link

same, i hate fb so difficult to work with.

@nileplumb
Copy link

been trying again today no success have tried various python's, PR's, forks and and their patches, and the alternative fbchat-asyncio.

simply defining my password leads to a 2FA request, which it seemingly passes then the above error occurs/
using an AppPassword instead gets this error

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/fbchat/_client.py", line 209, in login
    user_agent=user_agent,
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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/?email=user%40domain.com&li=CODEHERE&e=NUMBERS&shbl=1&refsrc=https%3A%2F%2Fwww.facebook.com%2F&_rdr)

@powerjungle
Copy link

powerjungle commented Nov 30, 2020

This seems to be a problem from "fbchat" itself. When I try a very simple login script it doesn't work.

Edit: Well it seems the project isn't maintained anymore. https://github.com/fbchat-dev/fbchat Look at the readme.

Edit 2: Also when reading around in the issues there, seems like facebook changed something drastically again...so yeah.

@nileplumb
Copy link

nileplumb commented Dec 1, 2020 via email

@powerjungle
Copy link

I tried making an alternative to this repo. Here it is: https://github.com/powerjungle/fbridge-asyncio

Anyone that can help or leave feedback, please do!

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

3 participants