fix: 解决IpInfoModel循环导入依赖问题

This commit is contained in:
Relakkes 2024-08-12 00:14:50 +08:00
parent c8dd40d547
commit 01ea4cd543
2 changed files with 4 additions and 5 deletions

View File

@ -10,7 +10,7 @@ from typing import List
import config
from cache.abs_cache import AbstractCache
from cache.cache_factory import CacheFactory
from tools import utils
from tools.utils import utils
from .types import IpInfoModel
@ -27,7 +27,8 @@ class ProxyProvider(ABC):
:param num: 提取的 IP 数量
:return:
"""
pass
raise NotImplementedError
class IpCache:

View File

@ -13,8 +13,6 @@ import httpx
from PIL import Image, ImageDraw
from playwright.async_api import Cookie, Page
from proxy import IpInfoModel
from . import utils
@ -137,7 +135,7 @@ def match_interact_info_count(count_str: str) -> int:
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"""
playwright_proxy = {
"server": f"{ip_proxy_info.protocol}{ip_proxy_info.ip}:{ip_proxy_info.port}",