From 5e00a419df9cdc4b26637cd353e2b836301ed2bd Mon Sep 17 00:00:00 2001 From: Toperlock <861705708@qq.com> Date: Thu, 13 Jun 2024 10:53:29 +0800 Subject: [PATCH] fix --- tool.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tool.py b/tool.py index 506a263c1..ccc160003 100644 --- a/tool.py +++ b/tool.py @@ -206,7 +206,10 @@ def is_ip(str): return re.search(r'^\d+\.\d+\.\d+\.\d+$',str) def get_protocol(s): - m = re.search(r'^(.+?)://', s) + try: + m = re.search(r'^(.+?)://', s) + except Exception as e: + return None if m: if m.group(1) == 'hy2': s = re.sub(r'^(.+?)://', 'hysteria2://', s) @@ -221,7 +224,6 @@ def get_protocol(s): s = re.sub(r'^(.+?)://', 'socks://', s) m = re.search(r'^(.+?)://', s) return m.group(1) - return None def checkKeywords(keywords,str): if not keywords: