Skip to content

Commit

Permalink
解决签到请求异常
Browse files Browse the repository at this point in the history
  • Loading branch information
leiyang committed Aug 7, 2023
1 parent 41f4b97 commit d2da5ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
## 使用docker镜像

运行命令:
<b> docker run -itd --name my-glados-checkin ly753/glados-checkin:3.0.0 -c='cookie' -http_proxy="http://192.168.1.8:7890" -https_proxy="http://192.168.1.8:78901" </b>
<b> docker run -itd --name my-glados-checkin ly753/glados-checkin:4.0.0 -c='cookie' -http_proxy="http://192.168.1.8:7890" -https_proxy="http://192.168.1.8:78901" </b>

1. -itd:后台运行,要查看日志请用docker logs命令。
2. --name:后面跟容器名字。
3. ly753/glados-checkin:3.0.0:镜像名字
3. ly753/glados-checkin:4.0.0:镜像名字
4. -c='cookie':到 https://glados.rocks/console/checkin 页面随便找一个接口,查看 request header 中的 Cooike ,整个拷贝下来,然后<b>去除cookie中间的空格</b>,替换到示例中的cookie,运行即可。

例如:
```shell
docker run -itd --name my-glados-checkin ly753/glados-checkin:3.0.0 -c='cookie:xxx'
docker run -itd --name my-glados-checkin ly753/glados-checkin:4.0.0 -c='cookie:xxx'
```

## 项目生成requirements.txt
Expand Down
12 changes: 10 additions & 2 deletions checkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,18 @@ def read_configuration():
if len(cookies):
try:
for cookie in cookies:
headers = {'Cookie': str(cookie)}
headers = {
"cookie": str(cookie),
"content-type": "application/json",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
"accept": "*/*",
"cache-control": "no-cache",
"host": "glados.rocks",
"accept-encoding": "gzip, deflate, br"
}

result = requests.post(url='https://glados.rocks/api/user/checkin',
data={"token": "glados.network"},
json={"token": "glados.one"},
headers=headers,
proxies=proxies).text
nowTime = time.strftime('%Y-%m-%d %X', time.localtime())
Expand Down

0 comments on commit d2da5ba

Please sign in to comment.