From ff78df7c71b8ccdb97afaf88ef1a7217db77fab8 Mon Sep 17 00:00:00 2001 From: niuhuan Date: Wed, 19 Jun 2024 17:23:59 +0800 Subject: [PATCH] fix: any pac error --- module/notification/telegram.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/notification/telegram.py b/module/notification/telegram.py index 27958783..227bd3d2 100644 --- a/module/notification/telegram.py +++ b/module/notification/telegram.py @@ -31,8 +31,10 @@ def macth_pac_settings(url: str, pac_url: str): :return: proxy or None """ pac = pypac.get_pac(url=pac_url) - pac_result = pac.find_proxy_for_url(url=url, host="0.0.0.0") - print(type(pac_result), pac_result) + if pac is None: + pac_result = None + else: + pac_result = pac.find_proxy_for_url(url=url, host="0.0.0.0") if isinstance(pac_result, str): pac_result = pac_result.split(";") pac_result = map(lambda x: x.strip(), pac_result)