python-a2s
python-a2s copied to clipboard
A2S Query API for Python
So recently while developing my app I encountered this error: ``` Traceback (most recent call last): ... File "/src/servers_updater/defaultA2S.py", line 26, in collect results = await asyncio.gather(*corutines) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/a2s/players.py",...
```python import a2s address = ("51.38.60.53", 27015) print(a2s.info(address), "\n===================") print(a2s.players(address), "\n===================") print(a2s.rules(address), "\n===================") ``` ``` ❯ python3 test.py GoldSrcInfo(address='51.38.60.53:27015', server_name='Emirates-KiNGS 亗 ||͇̿P͇̿U͇̿B͇̿L͇̿I͇̿C͇̿| ✪', map_name='de_dust2', folder='cstrike', game='Counter-Strike', player_count=32, max_players=32, protocol=47, server_type='d',...
``` Exception in callback _ProactorDatagramTransport._loop_reading()> Traceback (most recent call last): File "asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "asyncio\proactor_events.py", line 589, in _loop_reading self._protocol.datagram_received(data, addr) File "site-packages\a2s\a2s_async.py", line 70,...
Fix #57
```py def toDict(self, obj): return json.loads(json.dumps(obj, cls=CustomJSONEncoder)) class CustomJSONEncoder(json.JSONEncoder): #