diff --git a/.gitignore b/.gitignore index 9323a06..a45a254 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ bili.cookie /src/resources/temp /update_remote_code.py /src/resources/image/report/* +/src/resources/image/lightnovel/* +/wenku8.cookie diff --git a/src/clover_music/cloud_music/cloud_music.py b/src/clover_music/cloud_music/cloud_music.py index 8e8e7fb..a851060 100644 --- a/src/clover_music/cloud_music/cloud_music.py +++ b/src/clover_music/cloud_music/cloud_music.py @@ -61,6 +61,7 @@ def get_music(id): 使用二维码登录网易云音乐,需要先获取二维码的key,然后使用该key生成二维码,扫描二维码登录,最后通过登录接口 返回cookie 保存起来 """ save_path = os.getcwd()+'/src/clover_music/netease_music' +os.makedirs(save_path, exist_ok=True) qrcode_path = os.getcwd()+'/src/clover_music' diff --git a/src/plugins/check.py b/src/plugins/check.py index 35afd5b..daa90d9 100644 --- a/src/plugins/check.py +++ b/src/plugins/check.py @@ -83,4 +83,31 @@ async def spread_love(): test = on_command("test", rule=to_me(), priority=10, block=True) @test.handle() async def bot_on_ready(): - await test.finish("\nBoost & Magnum, ready fight!!!") \ No newline at end of file + await test.finish("\nBoost & Magnum, ready fight!!!") + + +import requests +from src.configs.api_config import wenku8_username, wenku8_password +# 登录页面的URL +login_url = 'https://www.wenku8.net/login.php?jumpurl=http%3A%2F%2Fwww.wenku8.net%2Findex.php' +index_url = 'https://www.wenku8.net/index.php' + +headers = { + 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2', + 'Connection': 'close', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.41', +} + +# 登录表单数据 +login_data = { + 'username': wenku8_username, + 'password': wenku8_password, + 'usecookie': '0', + 'action': 'login' +} +wenku8 = on_command("/wenku8", rule=to_me(), priority=10, block=True) +@wenku8.handle() +async def wenku8(): + # 注意:这里使用了Session对象来保持会话状态 + login_response = requests.post(login_url, data=login_data, headers=headers) + print(login_response) \ No newline at end of file