- You can call me MoeShin
- I'm a student of Automotive Electronics from LMU
moeshin / cx-auto-sign Goto Github PK
View Code? Open in Web Editor NEWThis project forked from cyanray/cx-auto-sign
⭐超星学习通自动签到工具,通过IM协议监测签到活动。
License: MIT License
This project forked from cyanray/cx-auto-sign
⭐超星学习通自动签到工具,通过IM协议监测签到活动。
License: MIT License
开启多个用户签到时,个别账号在挂几天后会掉。
相关配置如下:
appsettings.json
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*", "Kestrel": { "EndPoints": { "Http": { "Url": "http://*:5743" } } } }
用户配置文件:
{ "Username": "********", "Password": "********", "Fid": null, "WebApi": true, "ServerChanKey": "********", "Course": {******** } }
启动后控制台有相关启动日志:
浏览器无论是访问http://127.0.0.1:5743/status还是http://localhost:5743/status都无法访问:
[00:28:26 INF] 成功登录账号
[00:28:26 INF] 获取课程数据中...
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'value')
at Newtonsoft.Json.Utilities.ValidationUtils.ArgumentNotNull(Object value, String parameterName)
at Newtonsoft.Json.Linq.Extensions.Value[T,U](IEnumerable`1 value)
at Newtonsoft.Json.Linq.Extensions.Value[U](IEnumerable`1 value)
at CxSignHelper.CxSignClient.GetClassDetailAsync(String courseId, String classId) in /home/runner/work/cx-auto-sign/cx-auto-sign/CxSignHelper/CxSignClient.cs:line 176
at CxSignHelper.CxSignClient.GetCoursesAsync(JToken course) in /home/runner/work/cx-auto-sign/cx-auto-sign/CxSignHelper/CxSignClient.cs:line 150
at cx_auto_sign.UserDataConfig.UpdateAsync(CxSignClient client) in /home/runner/work/cx-auto-sign/cx-auto-sign/cx-auto-sign/UserDataConfig.cs:line 131
at cx_auto_sign.InitCommand.OnExecuteAsync(CommandLineApplication app) in /home/runner/work/cx-auto-sign/cx-auto-sign/cx-auto-sign/InitCommand.cs:line 31
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext context, CancellationToken cancellationToken)
at cx_auto_sign.Program.Main(String[] args) in /home/runner/work/cx-auto-sign/cx-auto-sign/cx-auto-sign/Program.cs:line 31
at cx_auto_sign.Program.<Main>(String[] args)
该项目是用于研究学习通签到、环信 IM WebSocket 协议。
由于不是直接调用 SDK,可能缺乏稳定性。
如果该项目失效或为了追求稳定实用性,可以看看一下两个项目,均直接调用环信 IM SDK:
请问怎么设置多账号自动侦测签到活动呢?
https://github.com/moeshin/cx-auto-sign/blob/main/README.md#webapi-说明
此处说是在配置文件内配置所监听的端口,可是没在readme的配置文件部分或配置文件模板中找到关于端口配置的任何方法信息。
大佬,我可以请教一下学习通IM获取签到的原理和大概过程嘛,只会一点py,看不懂大佬写的源码
dotnet ./cx-auto-sign.dll init -u "user" -p "pwd"
无法执行,因为找不到指定的命令或文件。
可能的原因包括:
*内置的 dotnet 命令拼写错误。
*你打算执行 .NET 程序,但 dotnet-./cx-auto-sign.dll 不存在。
*你打算运行全局工具,但在路径上找不到具有此名称且前缀为 dotnet 的可执行文件。
执行的时候会出现这样的问题,文件夹中是cx-auto-sign.sln,可是尝试更改后缀执行也是报错,不太明白,请求指点一下
可否在配置文件中添加自选TGAPI,或者允许直接填入完整api取代原本推送链接(例如:https://tg.push.com/bot:123.....)
我原本服务器时稳定低负载运行的,在触发位置签到不在指定范围内时。会导致服务器瞬间进入高负载状态,不知道是哪里出现了问题。目前服务器未响应,等待服务器响应以后拉取日志。
帐号1输出:
[14:43:58 INF] CXIM: Message received: h
[14:44:23 INF] CXIM: Message received: h
[14:44:48 INF] CXIM: Message received: h
[14:45:13 INF] CXIM: Message received: h
[14:45:38 INF] CXIM: Message received: h
[14:46:03 INF] CXIM: Message received: h
[14:46:28 INF] CXIM: Message received: h
[14:46:53 INF] CXIM: Message received: h
[14:47:18 INF] CXIM: Message received: h
[14:47:43 INF] CXIM: Message received: h
[15:04:02 ERR] [WEBSOCKET CLIENT] Exception while connecting. Waiting 60 sec before next reconnection try. Error: 'Unable to conne
ct to the remote server'
System.Net.WebSockets.WebSocketException (0x80004005): Unable to connect to the remote server
---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
---> System.Net.Sockets.SocketException (104): Connection reset by peer
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToke
n)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
at System.Net.Security.SslStream.<FillHandshakeBufferAsync>g__InternalFillHandshakeBufferAsync|182_0[TIOAdapter](TIOAdapter ada
p, ValueTask`1 task, Int32 minSize)
at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter)
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthen
ticationData, Boolean isApm)
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions s
slOptions, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options)
at System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options)
at Websocket.Client.WebsocketClient.<>c__DisplayClass65_0.<<GetClientFactory>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Websocket.Client.WebsocketClient.StartClient(Uri uri, CancellationToken token, ReconnectionType type, Boolean failFast)
[15:05:03 INF] CXIM: Message received: o
[15:05:03 INF] CXIM 登录
14:53:40,同班帐号2、3、4收到消息,但帐号1无提示,且未签到。帐号2输出:
[14:53:40 INF] 接收到课程消息
[14:53:40 INF] [1637650420328.1968] 消息时间:1637650420327.6873
这些帐号均在同一台机器上运行
运行的脚本版本为 8fbf8e1433eac8fb2e24d6e80254433fef49f03d
教师帐号输出:
[15:21:15 INF] CXIM: Message received: h
[15:21:25 INF] CXIM: Message received: a["CABAAkorCikSDzExODM3OTE1MTE2MzM5NhoWY29uZmVyZW5jZS5lYXNlbW9iLmNvbQ=="]
[15:21:25 INF] 接收到课程消息
[15:21:25 INF] [1637652085643.01] 消息时间:1637652085642.152
[15:21:25 INF] [1637652085643.01] ChatId: 118379151163396
[15:21:25 INF] [1637652085643.01] 获取 null 签到任务中
[15:21:26 ERR] [1637652085643.01] CXIM 接收到课程消息时出错
System.Exception: 非 200 状态响应:500 InternalServerError
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>tengine</center>
</body>
</html>
at CxSignHelper.CxSignClient.TestResponseCode(IRestResponse response) in C:\Users\uint128\Documents\projects\cx-auto-sign\CxSignHelper\CxSignClient.cs:line 244
at CxSignHelper.CxSignClient.GetSignTasksAsync(String courseId, String classId) in C:\Users\uint128\Documents\projects\cx-auto-sign\CxSignHelper\CxSignClient.cs:line 89
at cx_auto_sign.WorkCommand.<>c__DisplayClass5_0.<<OnExecuteAsync>g__OnMessageReceived|3>d.MoveNext() in C:\Users\uint128\Documents\projects\cx-auto-sign\cx-auto-sign\WorkCommand.cs:line 159
[15:21:26 WRN] [1637652085643.01] 由于 Email 为空,没有发送邮件通知
[15:21:26 WRN] [1637652085643.01] 由于 ServerChanKey 为空,没有发送 ServerChan 通知
[15:21:26 INF] [1637652085643.01] 正在发送 PushPlus 通知
[15:21:26 INF] [1637652085643.01] 已发送 PushPlus 通知
[15:21:50 INF] CXIM: Message received: h
运行的脚本版本为 8fbf8e1
不会影响正常签到,但会发送不必要的错误通知
我登录多个用户 但是开始签到就是AppConfig.json5里面 "DefaultUsername": "", // 默认用户,这里登录的账号,比如Configs 里面有3个用户,他就会以默认用户签到三次。其他的不签到
另外希望新加功能
按星期几或时间使用Images(同一门课有多个教室)、推送分用户
感谢作者一直更新!
近期挂的账户,出现了手势签到失败的情况。
获取手势正常
开始签到后签到失败
提示“非法请求”
已对程序升级,之后进行观测。
“因公司业务调整,pushplus将于2022年5月31日暂停服务。”
如果可能,加个Bark? (https://github.com/Finb/Bark) 感激不尽
https://api.day.app/{token}/{text}
通知的配置仅受应用配置文件所控制。这导致在多人签到时,所有通知都发送到了这个所配置的地方。
为什么不吧通知配置放在用户配置内达到通知精确到用户呢?
图片是前几次课其他人拍的照片,爬下来的 235kb
Images/机房.png
19:11:01 I attActiveType: 0
19:11:01 I aType: 0
19:11:01 I activeType: 2
19:11:01 I 签到类型:"图片签到"
19:11:01 E 上传图片失败
System.ArgumentNullException: Value cannot be null. (Parameter 'fileName')
at System.IO.FileInfo..ctor(String originalPath, String fullPath, String fileName, Boolean isNormalized) in //src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs:line 30
at System.IO.FileInfo..ctor(String fileName) in //src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs:line 23
at RestSharp.RestRequest.AddFile(String name, String path, String contentType)
at CxSignHelper.CxSignClient.UploadImageAsync(String path) in /home/runner/work/cx-auto-sign/cx-auto-sign/CxSignHelper/CxSignClient.cs:line 195
at cx_auto_sign.SignWork.GetImageIdAsync(CxSignClient client, DateTime now) in /home/runner/work/cx-auto-sign/cx-auto-sign/cx-auto-sign/SignWork.cs:line 105
19:11:01 I 将使用一张黑图进行图片签到
在自动签到的时候,出现了部分课程签到失败。但是测试的课程通过。
[10:15:22 INF] CXIM: Message received: 1 h
[10:15:47 INF] CXIM: Message received: 1 h
[10:16:04 INF] CXIM: Message received: 73 a["CABAAkorCikSDzE3ODU0NDQ5Mzc4OTE4NhoWY29uZmVyZW5jZS5lYXNlbW9iLmNvbQ=="]
[10:16:04 INF] 接收到课程消息并请求获取活动信息
[10:16:04 INF] CXIM: Message send: ["CABAAEorGikSDzE3ODU0NDQ5Mzc4OTE4NhoWY29uZmVyZW5jZS5lYXNlbW9iLmNvbVgA"]
[10:16:05 INF] CXIM: Message received: 349 a["CABAAEr7AQoCCAAiuAEI7JWA9Lm8ye4NEjkKDmN4LWRldiNjeHN0dWR5Eg8xNzg1NDQ0OTM3ODkxODYaFmNvbmZlcmVuY2UuZWFzZW1vYi5jb20gsoq5qoMwKAIyaAo5Cg5jeC1kZXYjY3hzdHVkeRIPMTc4NTQ0NDkzNzg5MTg2GhZjb25mZXJlbmNlLmVhc2Vtb2IuY29tEBEaJwoOY3gtZGV2I2N4c3R1ZHkSCDczMDQzMzg4GgtlYXNlbW9iLmNvbTgAKOyVgPS5vMnuDTIpEg8xNzg1NDQ0OTM3ODkxODYaFmNvbmZlcmVuY2UuZWFzZW1vYi5jb21A9JC5qoMw"]
[10:16:05 INF] 接收到课程消息
[10:16:05 INF] 释放 Session
[10:16:05 INF] CXIM: Message send: ["CABAAEo1EOyVgPS5vMnuDRopEg8xNzg1NDQ0OTM3ODkxODYaFmNvbmZlcmVuY2UuZWFzZW1vYi5jb21YAA=="]
[10:16:05 ERR] 解析失败,无法获取 Attachment
[10:16:05 INF] CXIM: Message received: 89 a["CABAAEo4CgIIADIpEg8xNzg1NDQ0OTM3ODkxODYaFmNvbmZlcmVuY2UuZWFzZW1vYi5jb204AUC2l7mqgzA="]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.