Skip to content

Commit

Permalink
🚨 auto fix by pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Apr 23, 2024
1 parent 07b8b94 commit a141dea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nonebot_plugin_bilifan/login/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from pathlib import Path

import aiohttp

import qrcode
import yaml
from nonebot.log import logger
Expand All @@ -16,6 +15,7 @@
access_key = ""
base_path = Path().joinpath("data/bilifan")


async def is_login(session, cookies):
api = "https://api.bilibili.com/x/web-interface/nav"
headers = {
Expand All @@ -41,7 +41,7 @@ async def get_tv_qrcode_url_and_auth_code():
headers={
"Host": "passport.bilibili.com",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.69"
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.69",
},
) as resp:
if resp.status != 200:
Expand Down Expand Up @@ -72,7 +72,7 @@ async def verify_login(login_key: str, data_path: Path):
headers={
"Host": "passport.bilibili.com",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.69"
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.69",
},
) as resp:
if resp.status != 200:
Expand All @@ -90,7 +90,7 @@ async def verify_login(login_key: str, data_path: Path):
filename = "login_info.txt"
data_path.mkdir(parents=True, exist_ok=True)
with (data_path / filename).open(mode="w", encoding="utf-8") as f:
f.write(access_key)
f.write(access_key)
if not Path(data_path / "users.yaml").is_file():
logger.info("初始化配置文件")
shutil.copy2(
Expand All @@ -105,6 +105,7 @@ async def verify_login(login_key: str, data_path: Path):
return "access_key已保存"
await asyncio.sleep(3)


appkey = "4409e2ce8ffd12b8"
appsec = "59b43e04ad6965f34319062b478f83dd"

Expand Down

0 comments on commit a141dea

Please sign in to comment.