From d4b7cb25ace3aa807873db880c6571ff24412654 Mon Sep 17 00:00:00 2001 From: Alexandr Korsak Date: Mon, 23 Feb 2015 11:16:58 +0700 Subject: [PATCH] Add option for choosing the host address Closes PR #26 --- youtube_dl_server/server.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/youtube_dl_server/server.py b/youtube_dl_server/server.py index d004afd5..1b2eb29e 100644 --- a/youtube_dl_server/server.py +++ b/youtube_dl_server/server.py @@ -24,6 +24,15 @@ def main(): help=port_help ) + default_host = 'localhost' + host_help = 'The host the server will use. The default is: {}' + host_help = host_help.format(default_host) + parser.add_argument('--host', + default=default_host, + type=str, + help=host_help + ) + parser.add_argument('--version', action='store_true', help='Print the version of the server') @@ -32,4 +41,4 @@ def main(): print(__version__) exit(0) - app.run('localhost', args.port) + app.run(args.host, args.port)