Giter Club home page Giter Club logo

chaoxing_auto_sign's Introduction

About me

Languages and Tools

My Stats

github-snake

chaoxing_auto_sign's People

Contributors

dependabot[bot] avatar handgrip avatar mkdir700 avatar rainysy avatar silentonz725 avatar ssmjae 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chaoxing_auto_sign's Issues

健康日报问题

能问下健康日报打那个,12.2日后就算调用成功也打不上卡了,哪里出问题了吗,求大佬解释
返回结果:
{"msg": "请勿重复提交", "success": false}

调用成功日志:
START RequestId: d035ed14-c739-4e91-97e6-c92bc7d67ee7

Event RequestId: d035ed14-c739-4e91-97e6-c92bc7d67ee7

Starting new HTTPS connection (1): passport2.chaoxing.com:443

https://passport2.chaoxing.com:443 "GET /api/login?name=20170802003&pwd=hhh52552326&verify=0&schoolid=1762 HTTP/1.1" 200 212

{'uname': '20170802003', 'roleid': '3', 'opacPwd': False, 'realname': '好耶', 'result': True, 'uid': 127968065, 'dxfid': 3626, 'phone': '15625151145', 'schoolid': 39037, 'cxid': 127968065, 'email': '', 'isCertify': 1, 'status': '0'}

Starting new HTTP connection (1): office.chaoxing.com:80

http://office.chaoxing.com:80 "GET /data/web/apps/forms/fore/user/list?cpage=1&formId=7185&enc=f837c93e0de9d9ad82db707b2c27241e&formAppId= HTTP/1.1" 200 398671

http://office.chaoxing.com:80 "POST /data/apps/forms/fore/user/save?lookuid=127973522 HTTP/1.1" 200 43

END RequestId: d035ed14-c739-4e91-97e6-c92bc7d67ee7

Report RequestId: d035ed14-c739-4e91-97e6-c92bc7d67ee7 Duration:1061ms Memory:128MB MemUsage:61.300781MB

bug提交

发现有账号存在获取不了课程签到的情况,其他账号测试正常。部分账号获取不了课程签到,显示无签到任务,问题账号已发大大的谷歌邮箱,希望看一下什么情况

几个小建议(自己在测试代码的发现一点小问题)

几个小问题

感谢 @mkdir700 的贡献,这里发现几个小问题,请教一下。

第一个关于 Cookie 是否有效的测试

r = self.session.get('http://i.mooc.chaoxing.com/app/myapps.shtml',allow_redirects=False)
if r.status_code != 200:
    print("cookies已失效")
    return False
else:
    print("cookies有效哦")
    return True

源代码中采用如上方法。但是在我的测试中,发现这个方法并不有效,因为我人工改了cookie之后,再次登录,返回的状态码依旧是200,但是返回的界面变了。

签到类型的判定

原代码中是通过id= startList,签到的div里面的文字。但是我通过id = endList里面的内容,发现这个文字似乎是能改的。具体怎样无法确定,现在手上没有教师账号没法测试。
我猜测可以通过onclick对应的activeDetail方法的第二参数判断。

如何获取照片上传的token?

在其他issue中,提及了如何上传照片。但是那个token应该你的。如何使用自己的获取自己的token呢?

请问一下如何测试的?

由于没有教师发布点到任务,我在的一些猜测无法测试。所以请教一下如何测试?自己注册一个教师账号吗?

其他小问题

  • 手势签到和二维码签到都是前端判定吗?
  • 是否不使用cookie更佳?超星的cookie判定似乎有问题,或许不使用,可以提高一点容错性。

以上内容可能不是完全正确的。部分场景无法测试,只是猜测。

运行报错module 'asyncio' has no attribute 'WindowsSelectorEventLoopPolicy'

Job "start (trigger: interval[0:00:20], next run at: 2021-04-22 08:11:49 HKT)" raised an exception
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "main.py", line 48, in start
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
AttributeError: module 'asyncio' has no attribute 'WindowsSelectorEventLoopPolicy'

通过api的位置签到,手势签到,二维码签到全都无效

为了使用二维码签到,我将api文件部署到了阿里云轻量服务器上(ps严格按照教程部署的),之后在用post请求测试的时候只有普通签到能够成功,但是返回的code一直是2000,message则一直是当前暂无签到任务,请问老哥这是什么问题呢😂。服务器系统是Ubuntu20.04,python是3.8.5,mongodb是4.4。

使用crontab运行时字典res为空

想服务器上运行,写了一个脚本

#!/usr/bin/bash
source ~/.bashrc &&
echo $(date "+%Y-%m-%d %H:%M:%S")
cd /sign/
py3 /sign/local_sign.py

然后发现手动运行时一切正确,使用crontab定时运行时,res就永远为空了
image

总是显示暂无签到任务

原先能够正常使用,在差不多两周以前无法正常使用,有签到任务也显示暂无签到任务,在今天更新并重新配置之后,在显示完课程ID和名称之后没有返回直接退出,运行显示如下:https://cloud.q4q3q9q9.top/index.php/s/RqN5xdm7kCEftBD
当时想签到的activeID:209586833
配置区只填了server酱和手机账号密码,不太知道是哪里出错了........

运行脚本后闪退

这是我的第三方库
certifi 2019.11.28
chardet 3.0.4
idna 2.9
pip 20.0.2
requests 2.23.0
urllib3 1.25.8

您好,请问为什么运行玩程序界面一闪而退?

因为界面一闪而退,所有不知道程序是不是在正常运行,这个是正常现象吗?新人如有冒犯请多谅解。这个是我的配置图,麻烦您帮我看一下哪里出了错误,运行完是没有控制台界面的。
QQ截图20200330104718

本地不支持二维码签到

希望本地可以加上二维码签到,这个可以设置为手动设置,签到的时候手动填入enc字段,之后运行

健康日报后台更新

大部分行失效,求大佬
返回数据:
{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Traceback (most recent call last):\n File "/var/user/index.py", line 209, in main_handler\n return h.daily_report()\n File "/var/user/index.py", line 189, in daily_report\n self._to_begin()\n File "/var/user/index.py", line 172, in _to_begin\n raw_data = self._get_last_heath_info()\n File "/var/user/index.py", line 67, in _get_last_heath_info\n raw_data = json.loads(resp.text)\n File "/var/lang/python3/lib/python3.6/json/init.py", line 354, in loads\n return _default_decoder.decode(s)\n File "/var/lang/python3/lib/python3.6/json/decoder.py", line 339, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n File "/var/lang/python3/lib/python3.6/json/decoder.py", line 357, in raw_decode\n raise JSONDecodeError("Expecting value", s, err.value) from None\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)","statusCode":430}

日志:

START RequestId:4bdb42f1-67e9-4cf8-9090-8cb6b7b9b1e4

Starting new HTTPS connection (1): passport2.chaoxing.com:443

https://passport2.chaoxing.com:443 "GET /api/login?name=20170802003&pwd=hhh52552326&verify=0&schoolid=1762 HTTP/1.1" 302 192

Starting new HTTP connection (1): office.chaoxing.com:80

http://office.chaoxing.com:80 "GET /data/web/apps/forms/fore/user/list?cpage=1&formId=7185&enc=f837c93e0de9d9ad82db707b2c27241e&formAppId= HTTP/1.1" 302 192

Starting new HTTP connection (1): learn.chaoxing.com:80

http://learn.chaoxing.com:80 "GET /error_404.html HTTP/1.1" 200 554

ERROR RequestId:4bdb42f1-67e9-4cf8-9090-8cb6b7b9b1e4 Result:{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Traceback (most recent call last):\n File "/var/user/index.py", line 209, in main_handler\n return h.daily_report()\n File "/var/user/index.py", line 189, in daily_report\n self._to_begin()\n File "/var/user/index.py", line 172, in _to_begin\n raw_data = self._get_last_heath_info()\n File "/var/user/index.py", line 67, in _get_last_heath_info\n raw_data = json.loads(resp.text)\n File "/var/lang/python3/lib/python3.6/json/init.py", line 354, in loads\n return _default_decoder.decode(s)\n File "/var/lang/python3/lib/python3.6/json/decoder.py", line 339, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n File "/var/lang/python3/lib/python3.6/json/decoder.py", line 357, in raw_decode\n raise JSONDecodeError("Expecting value", s, err.value) from None\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)","statusCode":430}

END RequestId:4bdb42f1-67e9-4cf8-9090-8cb6b7b9b1e4

Report RequestId:4bdb42f1-67e9-4cf8-9090-8cb6b7b9b1e4 Duration:626ms Memory:128MB MemUsage:46.511719MB

希望能加入Server酱微信推送

非常感谢开发者写了这么优秀的脚本,要是能添加上Server酱的微信推送就更完美了,签到成功后发送微信推送通知。

Server酱官网:http://sc.ftqq.com/3.version

另外控制台报 InsecureRequestWarning 产生大量无用日志,可以添加以下代码屏蔽它们:
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

版权问题

作者您好,我已在您的基础上更改代码实现无服务运行,并已附上您的github地址信息,如果版权有处理不好之处,请予以指点!谢谢您!
地址:https://github.com/Closty/chaoxing

搭建接口出现内部错误

(。・∀・)ノ゙嗨
你好,我也是饱受签到之苦的普通学生,在b站时候发现了一款可以签到的程序,不过部署还是未成功,不过在Github搜索时候难以置信还是有优秀的人开源签到代码。在搭建接口的时候我遇到了一点小麻烦,望作者能帮助到我。

问题

搭建成功后也可以访问FastAPI界面,在测试是否成功的时候出现了以下情况
image
相应的后台也出现了报错
image
我是按照作者的教程开始搭建的

资源

阿里云服务器
乌班图18.6版本系统
python3.6

搭建步骤

1. git clone https://github.com/mkdir700/chaoxing_auto_sign.git
2. cd chaoxing_auto_sign
3. pip3 install -r requirements.txt

然后运行起这个实例

都是默认自带的
pip install -r requirements.txt会报错误如下
image
浏览器访问https://passport2.chaoxing.com/api/login?name=账号&pwd=密码&schoolid=&verify=0如下
image

感谢发布自动签到代码

谢谢老哥了,,刚刚我测试,输入了手机号和密码,并没有登录成功,老是返回登录失败或者当前人数过多,自己手动get登录url可以登录成功,还请老哥优化一下,谢谢,我提个建议:去除学号登录,直接手机号加密码登录,毕竟更广泛,还有希望优化一下程序,我有更好的接口,可以签到所有,不用判断是哪种签到,希望老哥能带来一个更好的版本,希望能带来一个能挂在函数云上的版本,
链接: https://pan.baidu.com/s/1N9Ip4Qbw_lPO3jmzR2EfHA 提取码: Bell

程序运行:
手机号登录-获取所有课程id-获取所有活动列表签到id-get签到-程序结束。
希望再加上server酱实现签到成功消息通知!挂在函数云上,实现自动运行,(是个不错免费省事的方案)

哈哈哈,一不小心说了这么多,如果老哥愿意实现,那就拜托了,万分感谢!!!!

部署到服务器 返回错误

请问大佬 我部署到服务器后调用API返回是 {'msg': 4000, 'message': '未知错误'} 是为什么,我是小白

连接官方接口失败

2020-12-15 16:48:13,297 Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.8/lib/python3.7/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File "/root/.pyenv/versions/3.7.8/lib/python3.7/asyncio/base_events.py", line 962, in create_connection
raise exceptions[0]
File "/root/.pyenv/versions/3.7.8/lib/python3.7/asyncio/base_events.py", line 949, in create_connection
await self.sock_connect(sock, address)
File "/root/.pyenv/versions/3.7.8/lib/python3.7/asyncio/selector_events.py", line 473, in sock_connect
return await fut
File "/root/.pyenv/versions/3.7.8/lib/python3.7/asyncio/selector_events.py", line 503, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 110] Connect call failed ('42.62.107.178', 443)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "./cloud_sign.py", line 356, in run
result = await auto_sign.sign_tasks_run()
File "./cloud_sign.py", line 275, in sign_tasks_run
result: List[Optional[Dict]] = await asyncio.gather(*tasks)
File "./cloud_sign.py", line 206, in get_activeid
async with self.session.get(url) as resp:
File "/root/.pyenv/versions/3.7.8/lib/python3.7/site-packages/aiohttp/client.py", line 1117, in aenter
self._resp = await self._coro
File "/root/.pyenv/versions/3.7.8/lib/python3.7/site-packages/aiohttp/client.py", line 521, in _request
req, traces=traces, timeout=real_timeout
File "/root/.pyenv/versions/3.7.8/lib/python3.7/site-packages/aiohttp/connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "/root/.pyenv/versions/3.7.8/lib/python3.7/site-packages/aiohttp/connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/root/.pyenv/versions/3.7.8/lib/python3.7/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
raise last_exc
File "/root/.pyenv/versions/3.7.8/lib/python3.7/site-packages/aiohttp/connector.py", line 1032, in _create_direct_connection
client_error=client_error,
File "/root/.pyenv/versions/3.7.8/lib/python3.7/site-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host mobilelearn.chaoxing.com:443 ssl:default [Connect call failed ('42.62.107.178', 443)]

linux用curl测试mobilelearn.chaoxing.com返回405,用php带值测试可以签到成功。大大这是咋回事呀

获取不了签到课程信息

新的签到获取不了签到信息,请问大大这是被屏蔽了嘛?腾讯云

INFO: 210.22.245.219:52077 - "GET /sign?username=&password=
HTTP/1.1" 200 OK
cookies有 效 哦
1000
[] 0
[] 0
[] 0

接口问题求助

我想直接用html直接post接口 每天进一下网页就行了 但是提示
{
"detail": [
{
"loc": [
"query",
"username"
],
"msg": "field required",
"type": "value_error.missing"
},
{
"loc": [
"query",
"password"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
请问这个怎么解决呀

类型错误

if check_status['result'] == '0':
    return '验证码错误'

此处应该是int 0而不是str 0
手势签到是可以直接签到的,所以这个验证可以不加
另外fid考虑换成requests.utils.dict_from_cookiejar(self.session.cookies)['fid']?

只显示脚本已开始运行

只显示脚本已开始运行,有cookies生成,没有ActiveID生成,界面没反应,只能controlC
[root@instance-8 q4q3q9q9]# python3 cx.py
脚本已开始运行
^CTraceback (most recent call last):
File "cx.py", line 454, in
scheduler.start()
File "/usr/local/lib/python3.6/site-packages/apscheduler/schedulers/blocking.py", line 19, in start
self._main_loop()
File "/usr/local/lib/python3.6/site-packages/apscheduler/schedulers/blocking.py", line 28, in _main_loop
self._event.wait(wait_seconds)
File "/usr/lib64/python3.6/threading.py", line 551, in wait
signaled = self._cond.wait(timeout)
File "/usr/lib64/python3.6/threading.py", line 299, in wait
gotit = waiter.acquire(True, timeout)
KeyboardInterrupt
请问是我Python环境出问题了吗?
依赖已经安装(就是每安装一个依赖就说一次没有wheel报错)
Python3.6.8,pip20.1

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.