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" when "Info API down. Falling back to manual fetching..." #772

Open
4 tasks done
GustavRaispits opened this issue Dec 11, 2024 · 1 comment
Labels
unconfirmed bug Unconfirmed bug

Comments

@GustavRaispits
Copy link

GustavRaispits commented Dec 11, 2024

Summary

I use more selfbots at once, but when the Info API is detected to be down, "List index out of range" pops out.

Reproduction Steps

By running multiple profiles inside discord.py-self, this issue happens randomly (when the API is detected down).

Code

2024-12-11 16:04:23 - INFO - root - [(usernames...)] Logged in as (username)
2024-12-11 16:04:23 - INFO - root - [(usernames...)] Logged in as (username)
2024-12-11 16:04:23 - INFO - root - [(usernames...)] Logged in as (username)
2024-12-11 16:04:22 - WARNING - discord.utils - Info API down. Falling back to manual fetching...
2024-12-11 16:04:22 - WARNING - discord.utils - Info API down. Falling back to manual fetching...
2024-12-11 16:04:22 - WARNING - discord.utils - Info API down. Falling back to manual fetching...
2024-12-11 16:04:22 - WARNING - discord.utils - Info API down. Falling back to manual fetching...
2024-12-11 16:04:22 - WARNING - discord.utils - Info API down. Falling back to manual fetching...
2024-12-11 16:04:22 - WARNING - discord.utils - Info API down. Falling back to manual fetching...
2024-12-11 16:04:22 - INFO - discord.gateway - Connected to Gateway (Session ID: febd18ff43c8dda074211936d59f6333).
2024-12-11 16:04:22 - INFO - discord.gateway - Connected to Gateway (Session ID: 1eee34af8e4734f966c4ab0ee8849802).
2024-12-11 16:04:22 - INFO - discord.gateway - Connected to Gateway (Session ID: 073e2a618bb80e322463b1c13e2caf55).
2024-12-11 16:04:22 - INFO - discord.gateway - Connected to Gateway (Session ID: 2ed496e79c784eb3da81b51b846aad7c).
2024-12-11 16:04:22 - INFO - discord.gateway - Connected to Gateway (Session ID: 902603b07abe1a1b8d98c315f108c7f5).
2024-12-11 16:04:22 - INFO - discord.gateway - Connected to Gateway (Session ID: 3d8df9872b0ec3334c2dc3ed53cda824).
2024-12-11 16:04:23 - INFO - discord.gateway - Connected to Gateway (Session ID: 78dba3346be3a5f8ef77bd5d17621144).
2024-12-11 16:04:23 - INFO - discord.gateway - Connected to Gateway (Session ID: 237e75b7b993b337db95568102f61a9a).
2024-12-11 16:04:23 - INFO - discord.gateway - Connected to Gateway (Session ID: a6a47c511e646d1020b0c78c928f16a7).
2024-12-11 16:04:23 - INFO - discord.gateway - Connected to Gateway (Session ID: 4bdd4fdbbdb02b678d650c9dd610824f).
2024-12-11 16:04:23 - INFO - discord.gateway - Connected to Gateway (Session ID: 79512ab233ce546790e259c92f0c16aa).
2024-12-11 16:04:23 - INFO - root - [(usernames...)] Logged in as (username)
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Scripts\ActivitySelfbot\ActivitySelfbot.py", line 437, in <module>
    asyncio.run(run_bots(statuses_config))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Scripts\ActivitySelfbot\ActivitySelfbot.py", line 429, in run_bots
    await asyncio.gather(*[bot.start(account['token']) for bot, account in zip(bots, statuses_config['accounts'])])
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 857, in start
    await self.login(token)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 698, in login
    data = await state.http.static_login(token.strip())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\http.py", line 991, in static_login
    await self.startup()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\http.py", line 562, in startup
    self.super_properties, self.encoded_super_properties = sp, _ = await utils._get_info(session)
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\utils.py", line 1446, in _get_info
    bn = await _get_build_number(session)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\utils.py", line 1474, in _get_build_number
    build_url = 'https://discord.com/assets/' + re.compile(r'assets/+([a-z0-9]+)\.js').findall(login_page)[-2] + '.js'
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range

Expected Results

My selfbot should run without issues related to discord.py-self.

Actual Results

IndexError: list index out of range, then my program crashes.

System Information

  • Python v3.12.4-final
  • discord.py-self v2.0.0-final
  • aiohttp v3.9.5
  • system info: Windows 10 10.0.19045

Checklist

  • I have confirmed I am using unmodified discord.py-self and not the upstream discord.py.
  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

No response

@GustavRaispits GustavRaispits added the unconfirmed bug Unconfirmed bug label Dec 11, 2024
@outmaneuver
Copy link

outmaneuver commented Dec 19, 2024

am I the only one doing a simple client login and asyncio gather or is it wrong? I'm confused never ran into your issue (however I am using the dev branch)

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

No branches or pull requests

2 participants