From 487afc8e0c24361a936c0684592e4e3b8be5487b Mon Sep 17 00:00:00 2001 From: Relakkes Date: Wed, 17 Apr 2024 23:13:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E5=AF=BC?= =?UTF-8?q?=E6=8A=A5=E9=A1=BA=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- media_platform/weibo/client.py | 1 + media_platform/weibo/core.py | 5 +++-- media_platform/weibo/login.py | 3 ++- store/weibo/weibo_store_image.py | 1 + store/weibo/weibo_store_impl.py | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/media_platform/weibo/client.py b/media_platform/weibo/client.py index 21650e4..89b3ee1 100644 --- a/media_platform/weibo/client.py +++ b/media_platform/weibo/client.py @@ -12,6 +12,7 @@ from urllib.parse import urlencode import httpx from playwright.async_api import BrowserContext, Page + from tools import utils from .exception import DataFetchError diff --git a/media_platform/weibo/core.py b/media_platform/weibo/core.py index 1f12ec7..50b6b6c 100644 --- a/media_platform/weibo/core.py +++ b/media_platform/weibo/core.py @@ -10,10 +10,11 @@ import random from asyncio import Task from typing import Dict, List, Optional, Tuple -import config -from base.base_crawler import AbstractCrawler from playwright.async_api import (BrowserContext, BrowserType, Page, async_playwright) + +import config +from base.base_crawler import AbstractCrawler from proxy.proxy_ip_pool import IpInfoModel, create_ip_pool from store import weibo as weibo_store from tools import utils diff --git a/media_platform/weibo/login.py b/media_platform/weibo/login.py index c2e99af..dd0d737 100644 --- a/media_platform/weibo/login.py +++ b/media_platform/weibo/login.py @@ -8,10 +8,11 @@ import functools import sys from typing import Optional -from base.base_crawler import AbstractLogin from playwright.async_api import BrowserContext, Page from tenacity import (RetryError, retry, retry_if_result, stop_after_attempt, wait_fixed) + +from base.base_crawler import AbstractLogin from tools import utils diff --git a/store/weibo/weibo_store_image.py b/store/weibo/weibo_store_image.py index 6b89fe0..e870ad0 100644 --- a/store/weibo/weibo_store_image.py +++ b/store/weibo/weibo_store_image.py @@ -6,6 +6,7 @@ import pathlib from typing import Dict import aiofiles + from base.base_crawler import AbstractStoreImage from tools import utils diff --git a/store/weibo/weibo_store_impl.py b/store/weibo/weibo_store_impl.py index 673cc2a..e2df846 100644 --- a/store/weibo/weibo_store_impl.py +++ b/store/weibo/weibo_store_impl.py @@ -10,6 +10,7 @@ import pathlib from typing import Dict import aiofiles + from base.base_crawler import AbstractStore from tools import utils from var import crawler_type_var