diff --git a/README.md b/README.md index 3844749..838e360 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ ## 使用docker镜像 运行命令: - 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" + 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" 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 ,整个拷贝下来,然后去除cookie中间的空格,替换到示例中的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 diff --git a/checkin.py b/checkin.py index ebe3155..6aee403 100644 --- a/checkin.py +++ b/checkin.py @@ -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())