Yepoleb / python-a2s

A2S Query API for Python
MIT License
155 stars 17 forks source link

Problem with fetching info about Day:Z Servers #60

Closed aezaaaaa closed 1 week ago

aezaaaaa commented 1 week ago

Hello! When I try to get information about the Day:Z server, I always time out. And it doesn’t matter whether it’s an official server or not, what to do with it?

aezaaaaa commented 1 week ago
address = ('195.82.158.71', 10600)
aez = a2s.info(address)
print(aez)
Traceback (most recent call last):
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/disnake/ext/commands/slash_core.py", line 728, in invoke
    await call_param_func(self.callback, inter, self.cog, **kwargs)
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/disnake/ext/commands/params.py", line 1083, in call_param_func
    return await maybe_coroutine(safe_call, function, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/disnake/utils.py", line 567, in maybe_coroutine
    return await value
           ^^^^^^^^^^^
  File "/workspaces/DayZ-RU-Community/main.py", line 28, in server_info
    aez = a2s.info(address)
          ^^^^^^^^^^^^^^^^^
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/a2s/info.py", line 201, in info
    return request_sync(address, timeout, encoding, InfoProtocol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/a2s/a2s_sync.py", line 22, in request_sync
    response = request_sync_impl(conn, encoding, a2s_proto)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/a2s/a2s_sync.py", line 28, in request_sync_impl
    resp_data = conn.request(a2s_proto.serialize_request(challenge))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/a2s/a2s_sync.py", line 93, in request
    return self.recv()
           ^^^^^^^^^^^
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/a2s/a2s_sync.py", line 68, in recv
    packet = self._socket.recv(65535)
             ^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/disnake/ext/commands/interaction_bot_base.py", line 1378, in process_application_commands
    await app_command.invoke(interaction)
  File "/usr/local/python/3.12.1/lib/python3.12/site-packages/disnake/ext/commands/slash_core.py", line 737, in invoke
    raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TimeoutError: timed out