This commit is contained in:
Relakkes 2024-04-13 20:18:04 +08:00
parent c26270146f
commit 87eb8aa6a7
5 changed files with 9 additions and 9 deletions

View File

@ -63,7 +63,7 @@ class AbstractStoreImage(ABC):
async def store_image(self, image_content_item: Dict): async def store_image(self, image_content_item: Dict):
pass pass
class AbstactApiClient(ABC): class AbstractApiClient(ABC):
@abstractmethod @abstractmethod
async def request(self, method, url, **kwargs): async def request(self, method, url, **kwargs):
pass pass

View File

@ -10,7 +10,7 @@ from urllib.parse import urlencode
import httpx import httpx
from playwright.async_api import BrowserContext, Page from playwright.async_api import BrowserContext, Page
from base.base_crawler import AbstactApiClient from base.base_crawler import AbstractApiClient
from tools import utils from tools import utils
from .exception import DataFetchError from .exception import DataFetchError
@ -18,7 +18,7 @@ from .field import CommentOrderType, SearchOrderType
from .help import BilibiliSign from .help import BilibiliSign
class BilibiliClient(AbstactApiClient): class BilibiliClient(AbstractApiClient):
def __init__( def __init__(
self, self,
timeout=10, timeout=10,

View File

@ -7,7 +7,7 @@ import execjs
import httpx import httpx
from playwright.async_api import BrowserContext, Page from playwright.async_api import BrowserContext, Page
from base.base_crawler import AbstactApiClient from base.base_crawler import AbstractApiClient
from tools import utils from tools import utils
from var import request_keyword_var from var import request_keyword_var
@ -15,7 +15,7 @@ from .exception import *
from .field import * from .field import *
class DOUYINClient(AbstactApiClient): class DOUYINClient(AbstractApiClient):
def __init__( def __init__(
self, self,
timeout=30, timeout=30,

View File

@ -8,14 +8,14 @@ import httpx
from playwright.async_api import BrowserContext, Page from playwright.async_api import BrowserContext, Page
import config import config
from base.base_crawler import AbstactApiClient from base.base_crawler import AbstractApiClient
from tools import utils from tools import utils
from .exception import DataFetchError from .exception import DataFetchError
from .graphql import KuaiShouGraphQL from .graphql import KuaiShouGraphQL
class KuaiShouClient(AbstactApiClient): class KuaiShouClient(AbstractApiClient):
def __init__( def __init__(
self, self,
timeout=10, timeout=10,

View File

@ -8,7 +8,7 @@ import httpx
from playwright.async_api import BrowserContext, Page from playwright.async_api import BrowserContext, Page
import config import config
from base.base_crawler import AbstactApiClient from base.base_crawler import AbstractApiClient
from tools import utils from tools import utils
from .exception import DataFetchError, IPBlockError from .exception import DataFetchError, IPBlockError
@ -16,7 +16,7 @@ from .field import SearchNoteType, SearchSortType
from .help import get_search_id, sign from .help import get_search_id, sign
class XiaoHongShuClient(AbstactApiClient): class XiaoHongShuClient(AbstractApiClient):
def __init__( def __init__(
self, self,
timeout=10, timeout=10,