Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/nonebot_plugin_parser/parsers/bilibili/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class BilibiliParser(BaseParser):
platform: ClassVar[Platform] = Platform(name=PlatformEnum.BILIBILI, display_name="哔哩哔哩")

def __init__(self):
super().__init__()
self.headers = HEADERS.copy()
self._credential: Credential | None = None
self._cookies_file = pconfig.config_dir / "bilibili_cookies.json"
Expand Down
4 changes: 4 additions & 0 deletions src/nonebot_plugin_parser/parsers/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def name(self) -> str:
class TwitterParser(BaseParser):
platform: ClassVar[Platform] = Platform(name=PlatformEnum.TWITTER, display_name="小蓝鸟")

def __init__(self):
super().__init__()
self.headers = {"User-Agent": "python-httpx/0.28.1"}

@handle("x.com", r"x.com/[0-9-a-zA-Z_]{1,20}/status/([0-9]+)")
async def _parse(self, searched: re.Match[str]) -> ParseResult:
url = f"https://{searched.group(0)}"
Expand Down
Loading