import requests
import json
import time
# ========== 配置信息(直接写入代码) ==========
FEISHU_WEBHOOK = "https://open.feishu.cn/open-apis/bot/v2/hook/30ff1b91-bd07-4e99-a716-2e3a96436862"
IKUUU_URL = 'https://ikuuu.ch'
# 多个账号,格式为:[("邮箱", "密码"), ...]
USER_INFO_LIST = [
("111111@qq.com", "mima1111111111"),
("1111111@qq.com", "mima1111111111"),
]
# ===========================================
class FeishuBot:
def __init__(self, webhook_url):
self.webhook_url = webhook_url
def send_text(self, text, mentions=None):
headers = {"Content-Type": "application/json"}
content = {"text": text}
if mentions:
content["text"] = f"<at user_id=\"{mentions}\">{text}</at>"
payload = {"msg_type": "text", "content": content}
response = requests.post(self.webhook_url, headers=headers, data=json.dumps(payload))
if response.status_code == 200:
print("飞书消息发送成功")
else:
print(f"飞书消息发送失败,错误代码:{response.status_code}, 错误信息:{response.text}")
# 固定接口地址
login_url = f'{IKUUU_URL}/auth/login'
check_url = f'{IKUUU_URL}/user/checkin'
logout_url = f'{IKUUU_URL}/user/logout'
# 请求头
header = {
'origin': IKUUU_URL,
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36'
}
def checkIn(email, passwd, bot: FeishuBot):
session = requests.session()
data = {
'email': email,
'passwd': passwd
}
try:
print(f'账户【{email}】进行登录...')
response = session.post(url=login_url, headers=header, data=data).json()
print(response['msg'])
result = session.post(url=check_url, headers=header).json()
print(result['msg'])
bot.send_text(f"账号【{email}】签到结果:{result['msg']}")
session.get(logout_url)
except Exception as e:
content = f"账号【{email}】签到失败: {str(e)}"
print(content)
bot.send_text(content)
session.get(logout_url)
if __name__ == '__main__':
bot = FeishuBot(FEISHU_WEBHOOK)
for email, password in USER_INFO_LIST:
checkIn(email, password, bot)
time.sleep(2)