修复端口号丢失的问题

This commit is contained in:
zayac 2024-05-08 18:57:29 +08:00
parent 3fc1c2d556
commit 85cfc9ae60

View File

@ -91,7 +91,7 @@ def get_url_mapping(urls_with_context, template_type):
def extract_urls(text):
pattern = r'(?:\n|^)\s*([^\n]*?)\s*(https?://[\w\.-]+)'
pattern = r'(?:\n|^)\s*([^\n]*?)\s*(https?://[\w\.-]+(?::\d+)?)'
# pattern = r'(?:\n|^)\s*([^\n]*?)\s*(https?://[^\s]+)'
url_list = re.findall(pattern, text)
url_type, is_agent = get_url_type(text, url_list)