Giter Club home page Giter Club logo

tk-auto-study's Introduction

青年大学习/团课自动打卡

此处展示最近更新日志,完整日志搓这里

2022.07.28: 新增微软Azure的计算机视觉OCR,仔细阅读帮助文档来使用这个新功能

2022.08.24: 新增配置 maxRetry 自定义最大重试次数

2022.08.31: 新增pytesseract OCR识别, 需要安装依赖,Linux推荐(1.3.3及以上可用),修复send.mode总是fail的问题

🤺妈妈再也不用担心我团课没看被团支书赶着催了

点个:star:再走吧,❤感谢大家的Star和Fork,有问题可以发issue

仅供福建共青团团员学习交流使用 项目遵循GPL协议,请勿拿来盈利、诈骗和违法之事!否则后果需要自负。

参与贡献!

🖊️ 如果你有新的或更好OCR识别方式 请参考 OCR贡献文档 做出你的贡献!

🖊️ 如果你有新的或更好消息推送方式 请参考 消息推送贡献文档 做出你的贡献!

使用方法

🍎pub_key:

A7E74D2B6282AEB1C5EA3C28D25660A7

申请Ocr识别接口的权限 (1.3.1版本以后可选本地OCR,如果不使用BaiduAPI则跳过该步骤)

详细教程请点击这里

请选择使用一种可以识别文字的api,建议使用BaiduAI的Ocr接口

  • 首先要有一个百度账号,进入这个网址,点击控制台并登录
  • 完成个人实名认证,申请文字识别的使用权
  • 点击管理应用,点击创建应用,按要求填一些信息,创建完成后记住API KEYSECRET KEY

部署在平台上定时执行

这里介绍如何在GitHubActions中运行,因代理IP的相关代码,需确保Python3.9及以上版本。

  • fork该项目到你的库中

  • 添加三个secrets,分别为:username, pwd, pub_key

  • 1.3.0开始,需要添加验证码识别的OCR的 ocr_api_key,ocr_secret_key,ocr_type

  • 该文件中的#删除并修改cron为你想要触发的时间,默认是每周三14点运行一次,cron如何写请自行百度

    image

  • 进入 Actions 中手动触发一次(点击auto-study 右边 Run workflow),测试是否成功

    image

1.2.8 版本以上可以使用Docker脚本运行,使用环境变量配置参数(格式同Actions),可能无法配置多人打卡,可以尝试使用\n换行符(未测试)

如何在服务器上部署

在本地或者国内服务器上部署不需要代理,可兼容Python3.7版本

requirements.full.txt 包含了项目中所有可能的python依赖

requirements.txt 包含默认情况下需要的最少依赖

crontab

克隆项目并更改配置文件名称

git clone https://github.com/838239178/tk-auto-study.git && \
cd tk-auto-study && \
mv config.json.bak config.json

按照要求填写配置文件

vi config.json

修改 crontab

crontab -e
# 将下面这行复制到里面,cd的路径按照需要更改
00 08 * * 3 cd /root/tk-auto-study && python3 main.py >> crontab.log 2>&1
# 或者
00 08 * * 3 python3 /root/tk-auto-study/main.py >> crontab.log 2>&1

使用 crontab -l 查看是否修改成功

docker

除了crontab也可以使用目录下的docker-compose.yml,不需要填写 config.json 但需要修改文件内的environments

docker-compose up -d

可选识别类型

1.3.0 及以上

GithubAction(可选)添加新的secrets:ocr_type来指定识别类型

其他方式在config.json中修改指定配置项即可

可选值 使用方法 支持版本
baidu_image 默认方法,需要到百度AI中申请 1.3.0
tesseract 本地ocr识别,Windows推荐,Linux需要安装配置 1.3.1
azure 需要微软账号申请 1.3.2
pytesseract 需要安装依赖,推荐linux下使用 1.3.3

可选消息推送

1.2.2 版本及以上可用

使用消息推送 如微信推送、QQ推送

配置

GithubAction用户可通过添加secrets:send_type, send_key, send_mode 来使用消息推送

普通用户可查看最新的 config.json.bak 浏览新配置项

配置项解读

配置项 说明 可选值
send_type 消息推送类型 不填写则不推送 server_chan bark(Beta) push_plus
send_key 消息推送服务的密钥 在推送服务的官网注册获得
send_mode 推送模式 打卡失败时推送(fail) 打卡成功时推送(success) 无论成功与否都推送(both) 默认失败时推送 fail success both

多人打卡

仅支持 1.2.3 以上版本

配置多个账号一起打卡

  1. Github Action 上配置

    添加新secrets EXT_USERS, 按以下格式填写账号:

    手机号1 密码1
    手机号2 密码2
    

    原先配置的secrets不需要改动,建议自己保存好多人的账号密码,以便以后增加或删除账号

  2. 在本地 config.json 上配置

    参考 config.json.bak 的内容添加新的配置,原配置不需要改动

Stargazers over time

Stargazers over time

鸣谢

Pycharm 是一个在各个方面都最大程度地提高开发人员的生产力的 IDE,适用于 Python 语言。

特别感谢 JetBrains 为开源项目提供免费的 PyCharm 等 IDE 的授权

赏我一杯Coffee

qq_pic_merged_1633171137809

tk-auto-study's People

Contributors

saddit avatar dark-existed avatar miscdec avatar hsukqilee avatar sqlpxc avatar fooooooo-code avatar

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.