You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are importing mctools correctly, and are doing the correct function calls. However, the IP address you are passing to the QUERYClient is incorrect. The format of the connection string is like this:
[IP]:[PORT]
Simply fill in the sections with your connection information. For example, if you are connecting to the IP address 1.2.3.4:
query=QUERYClient('1.2.3.4')
If the system you are connecting to uses the default QUERY port, then you can omit the port section of the connection string, mctools will connect to the default port automatically. Lets say you wanted to connect to 55.67.149.52 on port 567:
query=QUERYClient('55.67.149.52:567')
Using this connection string, the client will then try to connect to the addresses you gave it. You can also use domain names in the connection string as well, let's say I wanted to connect to myserver.mc on port 123:
query=QUERYClient('myserver.mc:123')
The problem you are facing is that your connection string is incorrect:
query=QUERYClient('ip:port')
The client is trying to use ip as the IP address, and port and the port. Both of these are invalid, and you must provide a valid connection string. The error you encountered, socket.gaierror: [Errno 11001] getaddrinfo failed, means that your operating system was unable to determine the proper way to connect to the address you provided. If you use one of the methods above to construct your connection string, then things should work correctly for you.
Let me know if anything does not work as intended.
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Towa\AppData\Local\Programs\Python\Python39\lib\site-packages\mctools\mclient.py", line 709, in get_full_stats
chall = self.get_challenge().chall
File "C:\Users\Towa\AppData\Local\Programs\Python\Python39\lib\site-packages\mctools\mclient.py", line 645, in get_challenge
pack = self.raw_send(9, None, "chall")
File "C:\Users\Towa\AppData\Local\Programs\Python\Python39\lib\site-packages\mctools\mclient.py", line 625, in raw_send
self.proto.send(QUERYPacket(reqtype, self.reqid, chall, packet_type))
File "C:\Users\Towa\AppData\Local\Programs\Python\Python39\lib\site-packages\mctools\protocol.py", line 350, in send
self.write_udp(byts, self.host, self.port)
File "C:\Users\Towa\AppData\Local\Programs\Python\Python39\lib\site-packages\mctools\protocol.py", line 128, in write_udp
self.sock.sendto(byts, (host, port))
socket.gaierror: [Errno 11001] getaddrinfo failed
code:
from mctools import QUERYClient
query = QUERYClient('ip:port')
stats = query.get_full_stats()
Originally posted by @Towux in #11 (comment)
The text was updated successfully, but these errors were encountered: