dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
648 stars 153 forks source link

API temporarily down. Falling back to manual retrieval #671

Closed ye4241 closed 1 month ago

ye4241 commented 4 months ago

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

Additional Information

No response

dolfies commented 4 months ago

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

ccigas commented 3 months ago

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> 
ye4241 commented 3 months ago

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

dolfies commented 1 month ago

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