p2p_justuser/public.py

25 lines
526 B
Python
Raw Normal View History

import sys
import socket
from requests import get # Download file
port = sys.argv[1]
name = sys.argv[2]
##### Send our port to global list
# Get port
host = 'bore.pub'
2023-10-21 12:29:35 +00:00
file = get('https://gitea.gulyaipole.fun/justuser/p2p_justuser/raw/branch/main/list_server.info')
s_port = int(file.content)
# Send our port
client_socket = socket.socket()
client_socket.connect((host, s_port))
# Input name of server
message = str([port, name])
client_socket.send(message.encode())
client_socket.close()
print('SERVER POSTED')