本帖最后由 南归 于 2022-6-19 16:15 编辑 import requests
import re
session = requests.session()
url = "https://m.wugif.com/api/v1/session"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.124 Safari/537.36 Edg/102.0.1245.44"
}
data = {"user_login": "此处填账号", "password": "此处填密码", "nonce": "8b9e162efb"}
response = session.post(url=url, headers=headers, data=data) #登录
response_1 = session.get(url="https://m.wugif.com/", headers=headers).text
_wpnonce = re.findall(r'_wpnonce":"(.*?)"}', response_1)[0] #获取_wpnonce
# print(_wpnonce)
sign_data = {"_wpnonce": _wpnonce}
response_2 = session.post(
url="https://m.wugif.com/api/v1/actions/daily_sign", headers=headers, data=sign_data
) #签到
sign_message = re.findall(r'"message":"(.*?)","', response_2.text)[0]
print(sign_message.encode().decode("unicode-escape")) #获取签到结果
|