discord.py-self icon indicating copy to clipboard operation
discord.py-self copied to clipboard

API temporarily down. Falling back to manual retrieval

Open ye4241 opened this issue 1 year ago • 3 comments

Summary

Due to the api server is down, the bot starts slowly.

Reproduction Steps

https://github.com/dolfies/discord.py-self/blob/553cfa2bae2d7743f762685017aa13beaea93244/discord/utils.py#L1452

This server is down, could I remove the useless code, or fix that server to import bot start duration.

Same issue in discussion: #661

Code

No response

Expected Results

To start bot fast.

Actual Results

Bot starts slowly.

System Information

Python 3.10.11

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shared the entire traceback.
  • [X] I am using a user token (and it isn't visible in the code).

Additional Information

No response

ye4241 avatar Feb 27 '24 04:02 ye4241

The API will be back once I get some free time, sorry guys :(

dolfies avatar Mar 02 '24 17:03 dolfies

Hi, I am new to this project and getting that API down error. Not entirely sure how to do anything manually but just getting list index out of range when it goes manual.

Traceback (most recent call last):
  File "M:\PythonProjects\discord2\app.py", line 11, in <module>
    client.run('token')
  File "M:\PythonProjects\discord2\.venv\Lib\site-packages\discord\client.py", line 938, in run
    asyncio.run(runner())
  File "C:\Users\Cory Cigas\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\Cory Cigas\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Cory Cigas\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "M:\PythonProjects\discord2\.venv\Lib\site-packages\discord\client.py", line 927, in runner
    await self.start(token, reconnect=reconnect)
  File "M:\PythonProjects\discord2\.venv\Lib\site-packages\discord\client.py", line 857, in start
    await self.login(token)
  File "M:\PythonProjects\discord2\.venv\Lib\site-packages\discord\client.py", line 698, in login
    data = await state.http.static_login(token.strip())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "M:\PythonProjects\discord2\.venv\Lib\site-packages\discord\http.py", line 991, in static_login
    await self.startup()
  File "M:\PythonProjects\discord2\.venv\Lib\site-packages\discord\http.py", line 562, in startup
    self.super_properties, self.encoded_super_properties = sp, _ = await utils._get_info(session)
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "M:\PythonProjects\discord2\.venv\Lib\site-packages\discord\utils.py", line 1446, in _get_info
    bn = await _get_build_number(session)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "M:\PythonProjects\discord2\.venv\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
(.venv) PS M:\PythonProjects\discord2> 

ccigas avatar Mar 29 '24 02:03 ccigas

@ccigas please use git source git+https://github.com/dolfies/discord.py-self.git@master in pip, do not install from pip officical packages.

ye4241 avatar Mar 29 '24 02:03 ye4241

The API is back up now, sorry for the wait guys. The PyPi version should be working again. A release should be coming soon-ish

dolfies avatar May 15 '24 01:05 dolfies