GithubHelp home page GithubHelp logo

moeshin / cx-auto-sign Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cyanray/cx-auto-sign

38.0 38.0 3.0 352 KB

⭐超星学习通自动签到工具,通过IM协议监测签到活动。

License: MIT License

C# 96.74% Shell 3.26%

cx-auto-sign's Introduction

Github stats

Top Langs

MoeShin's wakatime stats

👋 Hello World! ฅ'ω'ฅ

  • You can call me MoeShin
  • I'm a student of Automotive Electronics from LMU

💻 Working environment

Windows 11 Ubuntu 20.04 LTS Debian 11
macOS 10.16 macOS 10.15
iOS 15 Android 13

Moe Counter!

Genshin

cx-auto-sign's People

Contributors

bingzi-233 avatar cyanray avatar dependabot[bot] avatar h13-0 avatar moeshin avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

yst1a h13-0 hankmo

cx-auto-sign's Issues

WebApi无法访问

相关配置如下:
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": {******** } }
启动后控制台有相关启动日志:
image
浏览器无论是访问http://127.0.0.1:5743/status还是http://localhost:5743/status都无法访问:
image

获取课程数据失败

[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:

ERR

image

#90 它取消了心跳显示,它这之后还在运行吗?

powershell运行时报错

dotnet ./cx-auto-sign.dll init -u "user" -p "pwd"
无法执行,因为找不到指定的命令或文件。
可能的原因包括:
*内置的 dotnet 命令拼写错误。
*你打算执行 .NET 程序,但 dotnet-./cx-auto-sign.dll 不存在。
*你打算运行全局工具,但在路径上找不到具有此名称且前缀为 dotnet 的可执行文件。
执行的时候会出现这样的问题,文件夹中是cx-auto-sign.sln,可是尝试更改后缀执行也是报错,不太明白,请求指点一下

v2.1.2无法添加账户

image
在rm -rf上一个版本之后 解压新版本使用init指令初始化,然后报错 The -u field is required.

WebSocket 超时时间过长

帐号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

当自己教的课有签到任务时,提示“非 200 状态响应”

教师帐号输出:

[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个用户,他就会以默认用户签到三次。其他的不签到

疑似升级,手势签到失败

近期挂的账户,出现了手势签到失败的情况。
获取手势正常
开始签到后签到失败
提示“非法请求”
已对程序升级,之后进行观测。

关于多用户通知的适配

通知的配置仅受应用配置文件所控制。这导致在多人签到时,所有通知都发送到了这个所配置的地方。
为什么不吧通知配置放在用户配置内达到通知精确到用户呢?

上传图片失败

图片是前几次课其他人拍的照片,爬下来的 235kb
Images/机房.png
截屏2022-04-20 19 40 07

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="]

无法进行签到

image
rt,发布签到消息后已经看不到签到提示的信息了,但是使用test参数时可以正常进行推送设置。

我怀疑是chaoxing把腾讯、阿里的服务器给屏蔽掉了。

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.