🐛 Fix login error

Co-authored-by: brian <brian@xtaolabs.com>
This commit is contained in:
brian 2023-03-08 22:44:41 +08:00 committed by GitHub
parent 60c32861ea
commit 99a9e627df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 3 deletions

View File

@ -1,2 +1,2 @@
from . import types, enums
from . import types, enums, errors
from .client import Client

2
cqwu/errors/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from .auth import *
from .base import *

View File

@ -37,7 +37,9 @@ class LoginWithPassword:
}
# 是否需要验证码
if not captcha_code:
form_data['captchaResponse'] = await self.check_captcha(show_qrcode=show_qrcode)
captcha_code = await self.check_captcha(show_qrcode=show_qrcode)
if captcha_code:
form_data['captchaResponse'] = captcha_code
# 登录
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',

View File

@ -1,5 +1,5 @@
httpx==0.23.3
lxml==4.9.1
lxml==4.9.2
PyExecJS2==1.6.1
beautifulsoup4==4.11.2
qrcode==7.4.2

31
setup.py Normal file
View File

@ -0,0 +1,31 @@
import setuptools # 导入setuptools打包工具
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="cqwu", # 用自己的名替换其中的YOUR_USERNAME_
version="0.0.2", # 包版本号,便于维护版本
author="omg-xtao", # 作者,可以写自己的姓名
author_email="xtao@xtaolink.cn", # 作者联系方式,可写自己的邮箱地址
description="A cqwu ehall client.", # 包的简述
long_description=long_description, # 包的详细介绍一般在README.md文件内
long_description_content_type="text/markdown",
url="https://github.com/cqwu-ehall/cqwu-ehall", # 自己项目地址比如github的项目地址
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6', # 对python的最低版本要求
install_requires=[
"httpx==0.23.3",
"lxml==4.9.2",
"PyExecJS2==1.6.1",
"beautifulsoup4==4.11.2",
"qrcode==7.4.2",
"pillow",
"pydantic==1.10.5",
],
)