Skip to content

Commit

Permalink
Merge pull request #276 from niuhuan/fix-pac
Browse files Browse the repository at this point in the history
fix: any pac error
  • Loading branch information
moesnow authored Jun 23, 2024
2 parents 0b60132 + ff78df7 commit e12db00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions module/notification/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e12db00

Please sign in to comment.