Giter Club home page Giter Club logo

chaoxing_sign's Introduction

前言

该脚本能够让你抛弃学习通签到的干扰,努力学习,专心听课

特点

  • 支持二维码、手势、位置等所有签到模式
  • 支持 Server 酱微信消息推送
  • 支持 docker+docker-compose 一键部署
  • 支持让同学帮你扫码签到,再也不用担心二维码过期,也不用带多余的手机了

快速使用

请先注册Server酱,以便接收微信推送签到消息

Server酱注册地址

注册绑定微信后有一个SCKEY,填入到下面部署的参数里

这里推荐两种方式部署:服务器部署、腾讯云函数

服务器部署(推荐)

前提是服务器需要有docker/docker-compose环境

  1. 克隆代码到服务器
git clone https://github.com/ncuhome/chaoxing 
  1. 编辑 account.json 按格式添加你的账号
[
  {
    "name": "姓名,用于备注",
    "username": "13688888888",
    "password": "123456",
    "sckey": "SCU*****",
    "send_wechat": true,
    "api_key": "随机字符串" // 可选的,可以用于代扫码签到
  }
]
  1. 启动容器
docker-compose up -d
  1. 添加/修改账号时直接修改account.json文件就可以了,不需要重启容器

腾讯云函数

腾讯云函数是可以白嫖的,每个月100万次免费调用,对于1分钟检查一次签到的需求完全够用,但网络流量需要收点费用

腾讯云函数不支持二维码签到,且需要准备一台 Redis 服务器,用于缓存登陆、签到记录

  1. 将本仓库克隆到本地 git clone https://github.com/exqlnet/chaoxing_sign
  2. 修改 cx_tx_scf.py 下的 <redis-host> 为你的 redis 服务器地址,如果不是默认端口,redis_port也要修改
  3. 修改 account.json 按照格式将你的帐号信息填入进去
  4. 执行 make txscf 得到 cx.zip
  5. 创建一个 Python3.6 运行环境的空的云函数
  6. 上传 cx.zip 到云函数,选择执行方法cx_tx_scf.main_handler,并保存
  7. 添加定时触发器

附加信息格式

{
    "username": "手机号",
    "password": "密码",
    "sckey": "SCU****",
    "send_wechat": "True"
}

代扫码签到使用说明

此签到方法需要同学帮你扫码,只是不需要你的同学带多台手机过去

  1. 服务器部署

  2. 配置 Nginx,且必须使用 ssl(否则网页无法开启摄像头扫码),proxy_pass 到服务器 8080 端口(docker-compose.yml 里可以配置这个端口)

  3. 配置 account.json,每个需要代签到的用户下面都需要有 api_key 字段,该字段用于将用户分组 & 访问权限

  4. 访问 https://<你的域名>/?api-key=<api-key> 给指定用户组的人签到,按照说明使用

扫码签到前端代码仓库:exqlnet/chaoxing_sign_fe

其他脚本推荐

mkdir700/chaoxing_auto_sign

chaoxing_sign's People

Contributors

exqlnet avatar kingcanfish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chaoxing_sign's Issues

启动容器卡住

docker-compose up -d
在上面那个代码运行的时候,会卡住下载
Creating network "chaoxing_default" with the default driver
Pulling redis (redis:3.2)...
3.2: Pulling from library/redis
f17d81b4b692: Pull complete
b32474098757: Pull complete
8980cabe8bc2: Pull complete
58af19693e78: Pull complete
a977782cf22d: Pull complete
9c1e268980b7: Pull complete
Building cx_web
Step 1/4 : FROM python:3.8
3.8: Pulling from library/python
e22122b926a1: Pull complete
f29e09ae8373: Pull complete
e319e3daef68: Pull complete
e499244fe254: Pull complete
5a6ebed20e89: Downloading [> ] 3.214MB/192.3MB
56b703a5a371: Download complete
dec810778c22: Download complete
505aac614a24: Download complete
36deae172a15: Download complete
我大概知道事因为服务器连接外网的问题,我是想问问怎么能解决下。麻烦大佬了

云函数调用失败 求解

日志:

ERROR RequestId:e563c248-acbd-4dc1-9315-3990536cd3ad Result:{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Traceback (most recent call last):\n File "/var/user/redis/connection.py", line 585, in _connect\n socket.SOCK_STREAM):\n File "/var/lang/python3/lib/python3.6/socket.py", line 743, in getaddrinfo\n for res in _socket.getaddrinfo(host, port, family, type, proto, flags):\nsocket.gaierror: [Errno -2] Name or service not known\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/var/runtime/python3/bootstrap.py", line 176, in handle\n ret = self.real_handler(event, context)\n File "/var/user/cx_tx_scf.py", line 15, in main_handler\n s = AutoSign(username, password, server_chan_key, redis_host="\u003credis-host\u003e", redis_port=6379)\n File "/var/user/cx.py", line 31, in init\n if not self.check_cookies_status():\n File "/var/user/cx.py", line 45, in check_cookies_status\n cookies_byte = self.cache.get(self.username + "_cookies")\n File "/var/user/redis/client.py", line 1606, in get\n return self.execute_command('GET', name)\n File "/var/user/redis/client.py", line 898, in execute_command\n conn = self.connection or pool.get_connection(command_name, **options)\n File "/var/user/redis/connection.py", line 1192, in get_connection\n connection.connect()\n File "/var/user/redis/connection.py", line 563, in connect\n raise ConnectionError(self._error_message(e))\nredis.exceptions.ConnectionError: Error -2 connecting to \u003credis-host\u003e:6379. Name or service not known.","statusCode":430}

Report RequestId:e563c248-acbd-4dc1-9315-3990536cd3ad Duration:71ms Memory:512MB MemUsage:23.976562MB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.