mirror of
https://github.com/RYDE-WORK/MediaCrawler.git
synced 2026-02-03 06:54:50 +08:00
47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
# @Author : relakkes@gmail.com
|
|
# @Time : 2023/12/2 18:44
|
|
# @Desc : bilibli登录类实现
|
|
|
|
import asyncio
|
|
import functools
|
|
import sys
|
|
from typing import Optional
|
|
|
|
import redis
|
|
from playwright.async_api import BrowserContext, Page
|
|
from tenacity import (RetryError, retry, retry_if_result, stop_after_attempt,
|
|
wait_fixed)
|
|
|
|
import config
|
|
from base.base_crawler import AbstractLogin
|
|
from tools import utils
|
|
from base.base_crawler import AbstractLogin
|
|
|
|
|
|
class BilibiliLogin(AbstractLogin):
|
|
def __init__(self,
|
|
login_type: str,
|
|
browser_context: BrowserContext,
|
|
context_page: Page,
|
|
login_phone: Optional[str] = "",
|
|
cookie_str: str = ""
|
|
):
|
|
self.login_type = login_type
|
|
self.browser_context = browser_context
|
|
self.context_page = context_page
|
|
self.login_phone = login_phone
|
|
self.cookie_str = cookie_str
|
|
|
|
async def begin(self):
|
|
pass
|
|
|
|
async def login_by_qrcode(self):
|
|
pass
|
|
|
|
async def login_by_mobile(self):
|
|
pass
|
|
|
|
async def login_by_cookies(self):
|
|
pass
|