执行 Ruff 安全自动修复
This commit is contained in:
@@ -8,7 +8,6 @@ import re
|
||||
import threading
|
||||
import time
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional
|
||||
|
||||
import requests
|
||||
from loguru import logger
|
||||
@@ -144,12 +143,12 @@ class BaseWhitelistAdapter(ABC):
|
||||
return False, msg
|
||||
|
||||
@staticmethod
|
||||
def get_local_exit_ip() -> Optional[str]:
|
||||
def get_local_exit_ip() -> str | None:
|
||||
"""获取本机当前公网出口IP(不走代理)。"""
|
||||
return _get_local_exit_ip()
|
||||
|
||||
|
||||
def _get_local_exit_ip() -> Optional[str]:
|
||||
def _get_local_exit_ip() -> str | None:
|
||||
"""获取本机当前公网出口IP(不走代理)。"""
|
||||
targets = [
|
||||
"https://myip.ipip.net",
|
||||
@@ -171,7 +170,7 @@ def _get_local_exit_ip() -> Optional[str]:
|
||||
return None
|
||||
|
||||
|
||||
def get_exit_ip_via_proxy(proxy: str) -> Optional[str]:
|
||||
def get_exit_ip_via_proxy(proxy: str) -> str | None:
|
||||
"""通过代理获取出口IP。"""
|
||||
targets = [
|
||||
"https://qifu-api.baidubce.com/ip/local/geo/v1/district",
|
||||
|
||||
Reference in New Issue
Block a user