forked from lewis-007/MediaCrawler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5aeee93
commit a90b411
Showing
6 changed files
with
303 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# @Author : [email protected] | ||
# @Time : 2023/12/3 16:20 | ||
# @Desc : | ||
|
||
from enum import Enum | ||
|
||
|
||
class OrderType(Enum): | ||
# 综合排序 | ||
DEFAULT = "" | ||
|
||
# 最多点击 | ||
MOST_CLICK = "click" | ||
|
||
# 最新发布 | ||
LAST_PUBLISH = "pubdate" | ||
|
||
# 最多弹幕 | ||
MOST_DANMU = "dm" | ||
|
||
# 最多收藏 | ||
MOST_MARK = "stow" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,38 @@ | ||
# -*- coding: utf-8 -*- | ||
# @Author : [email protected] | ||
# @Time : 2023/12/2 18:44 | ||
# @Desc : | ||
# @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 | ||
|
||
|
Oops, something went wrong.