fix port parsing

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

View file

@ -129,8 +129,8 @@ def main():
prefix = os.path.expanduser('~/Videos/CDOSEA') prefix = os.path.expanduser('~/Videos/CDOSEA')
parser = argparse.ArgumentParser(description='play 2 screens in sync') parser = argparse.ArgumentParser(description='play 2 screens in sync')
parser.add_argument('--peer', help='ipof peer', required=True) 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('--port', type=int, help='local port', default=DEFAULT_PORT)
parser.add_argument('--playlist', help='play.m3u', default=playlist) parser.add_argument('--playlist', help='play.m3u', default=playlist)
parser.add_argument('--prefix', help='video location', default=prefix) 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) parser.add_argument('--debug', action='store_true', help='debug', default=False)
args = parser.parse_args() args = parser.parse_args()
if ':' in args.peer: peer = (args.peer, args.peer_port)
peer = args.peer.split(':')
peer = (peer[0], int(peer[1]))
else:
peer = (args.peer, DEFAULT_PORT)
time.sleep(10) time.sleep(10)