diff --git a/bilireq/login/__init__.py b/bilireq/login/__init__.py index 8287600..815600a 100644 --- a/bilireq/login/__init__.py +++ b/bilireq/login/__init__.py @@ -88,8 +88,7 @@ async def qrcode_login(self, auth_code=None, retry=-1, interval=1): try: resp = await get_qrcode_login_result(auth_code) auth = Auth() - auth.access_token = resp["token_info"]["access_token"] - auth.refresh_token = resp["token_info"]["refresh_token"] + auth.data = auth.refresh_handler(resp) return await auth.refresh() except ResponseCodeError as e: if e.code != 86039: diff --git a/pyproject.toml b/pyproject.toml index 67dd972..d88219c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ dependencies = [ "protobuf>=4.23.4", ] name = "bilireq" -version = "0.2.9" +version = "0.2.10" description = "又一个哔哩哔哩请求库" license = {text = "MIT"} diff --git a/test/test_login.py b/test/test_login.py new file mode 100644 index 0000000..3259a75 --- /dev/null +++ b/test/test_login.py @@ -0,0 +1,26 @@ +import asyncio + +from bilireq.login import Login + +PHONE_NUM = 1 +PASSWD = 1 + + +async def main(): + print("===== 二维码登录 =====") + login = Login() + image = await login.get_qrcode() + image.show() # type: ignore + await login.qrcode_login(interval=5) + + # print("===== 验证码登录 =====") # 不可用 + # login = Login() + # await login.send_sms(PHONE_NUM) + # await login.sms_login(input("请输入验证码: ")) + + # print("==== 账号密码登录 ====") # 不可用 + # login = Login() + # await login.pwd_login(str(PHONE_NUM), PASSWD) + + +asyncio.run(main())