From 3c33c36becf10501b30c1c5a817d11800c097d77 Mon Sep 17 00:00:00 2001 From: chenhuajian Date: Mon, 30 Nov 2020 11:35:49 +0800 Subject: [PATCH] fix bug --- v2ray_util/config_modify/cdn.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/v2ray_util/config_modify/cdn.py b/v2ray_util/config_modify/cdn.py index 8ea441c8..715fffed 100644 --- a/v2ray_util/config_modify/cdn.py +++ b/v2ray_util/config_modify/cdn.py @@ -71,11 +71,14 @@ def modify(): port_choice = loop_input_choice_number(_("please select https port to cdn: "), len(https_list)) if not port_choice: return - elif port_is_use(port_choice): - print("{} port is use!".format(port_choice)) + new_port = https_list[port_choice - 1] + if port_is_use(new_port): + print("{} port is use!".format(new_port)) return print("") for index, text in enumerate(cdn_protocol_list): print("{}.{}".format(index + 1, text)) cdn_choice = loop_input_choice_number(_("please select protocol to cdn: "), len(cdn_protocol_list)) - CDNModifier(domain, cdn_choice - 1).open(https_list[port_choice - 1]) \ No newline at end of file + if not cdn_choice: + return + CDNModifier(domain, cdn_choice - 1).open(new_port) \ No newline at end of file