forked from 20142995/cutecloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
26 lines (19 loc) · 1.19 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import os
import httpx
CUTECLOUD_EMAIL = os.getenv('CUTECLOUD_EMAIL')
CUTECLOUD_PASSWD = os.getenv('CUTECLOUD_PASSWD')
base_url = "https://www.cutecloud.net"
with httpx.Client(base_url=base_url, verify='cacert.pem') as client:
headers = {"Sec-Ch-Ua": "\"Not A(Brand\";v=\"24\", \"Chromium\";v=\"110\"", "Accept": "*/*",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "X-Requested-With": "XMLHttpRequest",
"Sec-Ch-Ua-Mobile": "?0", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.5481.178 Safari/537.36", "Sec-Ch-Ua-Platform": "\"Windows\"",
"Origin": base_url, "Sec-Fetch-Site": "same-origin", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Dest": "empty",
"Referer": f"{base_url}/auth/login", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9"}
data = {"email": CUTECLOUD_EMAIL, "passwd": CUTECLOUD_PASSWD}
rj1 = client.post("/auth/login",data=data,headers=headers).json()
print(rj1)
if rj1['ret'] == 1:
rj2 = client.post("/user/checkin",headers=headers).json()
print(rj2)