mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
feat(.gitignore): 添加忽略文件、测试wenku8连通
This commit is contained in:
parent
29ed0821dd
commit
511cd92c3a
3 changed files with 31 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -21,3 +21,5 @@ bili.cookie
|
|||
/src/resources/temp
|
||||
/update_remote_code.py
|
||||
/src/resources/image/report/*
|
||||
/src/resources/image/lightnovel/*
|
||||
/wenku8.cookie
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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!!!")
|
||||
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)
|
||||
Loading…
Reference in a new issue