fix: 解决IpInfoModel循环导入依赖问题
This commit is contained in:
parent
c8dd40d547
commit
01ea4cd543
|
@ -10,7 +10,7 @@ from typing import List
|
||||||
import config
|
import config
|
||||||
from cache.abs_cache import AbstractCache
|
from cache.abs_cache import AbstractCache
|
||||||
from cache.cache_factory import CacheFactory
|
from cache.cache_factory import CacheFactory
|
||||||
from tools import utils
|
from tools.utils import utils
|
||||||
|
|
||||||
from .types import IpInfoModel
|
from .types import IpInfoModel
|
||||||
|
|
||||||
|
@ -27,7 +27,8 @@ class ProxyProvider(ABC):
|
||||||
:param num: 提取的 IP 数量
|
:param num: 提取的 IP 数量
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
pass
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class IpCache:
|
class IpCache:
|
||||||
|
|
|
@ -13,8 +13,6 @@ import httpx
|
||||||
from PIL import Image, ImageDraw
|
from PIL import Image, ImageDraw
|
||||||
from playwright.async_api import Cookie, Page
|
from playwright.async_api import Cookie, Page
|
||||||
|
|
||||||
from proxy import IpInfoModel
|
|
||||||
|
|
||||||
from . import utils
|
from . import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -137,7 +135,7 @@ def match_interact_info_count(count_str: str) -> int:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def format_proxy_info(ip_proxy_info: IpInfoModel) -> Tuple[Optional[Dict], Optional[Dict]]:
|
def format_proxy_info(ip_proxy_info) -> Tuple[Optional[Dict], Optional[Dict]]:
|
||||||
"""format proxy info for playwright and httpx"""
|
"""format proxy info for playwright and httpx"""
|
||||||
playwright_proxy = {
|
playwright_proxy = {
|
||||||
"server": f"{ip_proxy_info.protocol}{ip_proxy_info.ip}:{ip_proxy_info.port}",
|
"server": f"{ip_proxy_info.protocol}{ip_proxy_info.ip}:{ip_proxy_info.port}",
|
||||||
|
|
Loading…
Reference in New Issue