fix port parsing

This commit is contained in:
j 2023-10-12 12:27:26 +01:00
parent df1eb190cb
commit b2efaf8ece

View file

@ -130,7 +130,7 @@ def main():
parser = argparse.ArgumentParser(description='play 2 screens in sync')
parser.add_argument('--peer', help='ip of peer', required=True)
parser.add_argument('--peer', help='port of peer')
parser.add_argument('--peer-port', help='port of peer', default=DEFAULT_PORT)
parser.add_argument('--port', type=int, help='local port', default=DEFAULT_PORT)
parser.add_argument('--playlist', help='play.m3u', default=playlist)
parser.add_argument('--prefix', help='video location', default=prefix)
@ -138,11 +138,7 @@ def main():
parser.add_argument('--debug', action='store_true', help='debug', default=False)
args = parser.parse_args()
if ':' in args.peer:
peer = args.peer.split(':')
peer = (peer[0], int(peer[1]))
else:
peer = (args.peer, DEFAULT_PORT)
peer = (args.peer, args.peer_port)
time.sleep(10)