2023-06-27 23:38:30 +08:00
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
2023-12-02 16:14:36 +08:00
|
|
|
from proxy.proxy_account_pool import AccountPool
|
2023-07-29 15:35:40 +08:00
|
|
|
|
2023-06-27 23:38:30 +08:00
|
|
|
|
|
|
|
|
class AbstractCrawler(ABC):
|
|
|
|
|
@abstractmethod
|
2023-12-08 00:10:04 +08:00
|
|
|
def init_config(self, platform: str, login_type: str, crawler_type: str):
|
2023-06-27 23:38:30 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def start(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
2023-07-29 15:35:40 +08:00
|
|
|
async def search(self):
|
2023-06-27 23:38:30 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AbstractLogin(ABC):
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def begin(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def login_by_qrcode(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def login_by_mobile(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def login_by_cookies(self):
|
|
|
|
|
pass
|