Coder Social home page Coder Social logo

wisdomtree's Introduction

wisdomtree

A simple script that makes studying much easier.

Install

Requires Python 3.6+

  • git clone https://github.com/yunv/wisdomtree
  • pip3 install -r requirements.txt

Usage

  • Run study.py with Python3 (python study.py on Windows, python3 study.py on Linux and macOS)
  • Enter your phone number and password, userId will be saved and you will not need to login again.
  • Press y when it found the right course.
  • All lessons will be marked as watched.
  • It will try correct answers out. This feature is considered dangerous and requires to change TAKE_EXAMS flag to True in study.py. If you also want to submit exams automatically, change EXAM_AUTO_SUBMIT flag to True. Exams that contain short answer questions will not be submitted automatically.

Notice

Deprecation of exam submission

As of December 2017, server no longer returns realAnswer, so it's impossible to save correct answers directly. You should do exams yourself.

A brute force method

However, there is an API where we can see scores of every question so a trial-and-error method is implemented. It requires a lot of communication with the server. Use at your own risk.

wisdomtree's People

Contributors

comwrg avatar yunowo 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

Watchers

 avatar  avatar  avatar  avatar  avatar

wisdomtree's Issues

又一个小bug

c = random.choice(question['possibleAnswers'])
这行代码略有小问题,如果question['possibleAnswers']最后变成了空,代码就会报错,然后就只能重复运行一次了emmm,因为真的有些题目他就是没有答案!用四个选项去测试,他得到的最终分数都是0,导致把所有answer都排除完了之后,仍然没有选到正确答案,凉凉~emmm
解决方式,未知

What's this?After I login and press y,it return this.

Traceback (most recent call last):
File "study.py", line 100, in
save_record(lesson, None, None)
File "study.py", line 89, in save_record
logger.info(dic['name'] + r.json()['studyPercenter'])
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 866, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

some problem need slove

Traceback (most recent call last):
File "study.py", line 137, in
save_record(section, lesson, True)
File "study.py", line 126, in save_record
rt = post('/student/tutorial/saveStudyRecordByTokenEncry', p)
File "study.py", line 30, in post
j = r.json()
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

some error in python3.6 system ubuntu16.04LTS

Traceback (most recent call last):
File "study.py", line 131, in
save_record(section, True)
File "study.py", line 105, in save_record
if f'L{dic["id"]}' in studied and studied[f'L{dic["id"]}']['watchState'] == 1:
TypeError: argument of type 'NoneType' is not iterable

Crashes after 'videos done'

With the recently updated version, videos are done perfectly, but the script crashes while doing exams.
Details:

Traceback (most recent call last):
  File "study.py", line 187, in <module>
    for question in r.json()['rt']['examList']:
KeyError: 'rt'

I have tried four times in two courses (two times each). The log above was printed three times, and the log below was printed one time.

Traceback (most recent call last):
  File "study.py", line 223, in <module>
    d = json.loads(r.text.replace('"{', '{').replace('}"', '}').replace('\\', ''))['rt']
KeyError: 'rt'

something wrong

hello here are some touble that i could't slove it ,could you please hele me
if i run this program

Traceback (most recent call last):
File "study.py", line 137, in
save_record(section, lesson, True)
File "study.py", line 126, in save_record
rt = post('/student/tutorial/saveStudyRecordByTokenEncry', p)
File "study.py", line 30, in post
j = r.json()
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

please help me soon

thanks :-)

原来登陆成功的SECRET可用,重新登录发现登录功能失效

Traceback (most recent call last):
  File "study.py", line 90, in <module>
    user, name, secret = login()
  File "study.py", line 40, in login
    ticket = post(NONE, '/api/ticket', p)
  File "study.py", line 30, in post
    return r.json()['rt']
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

服务器暂无回应,请稍后重试

Traceback (most recent call last):
File "study.py", line 131, in
save_record(section, lesson['chapterId'], True)
File "study.py", line 120, in save_record
rt = post('/student/tutorial/saveLearningRecordByToken', p)
File "study.py", line 32, in post
raise ValueError(j['msg'])
ValueError: 服务器暂无回应,请稍后重试

Should I open the website to make the exam begin?

It's time to do the exam, but it can't work.
Like this:

2017-05-27 12:18:07,394 INFO     Videos done.
2017-05-27 12:18:07,550 INFO     营养与食疗学教程考试
Traceback (most recent call last):
  File "study.py", line 173, in <module>
    ids = post(SIGN, '/student/exam/examQuestionIdListByCache', p)['examList']
KeyError: 'examList'

Should I open the website to make the exam begin? Like this?
image

又又又又报错啦~

Traceback (most recent call last):
  File "study3.py", line 167, in <module>
    p = {**j, 'secretStr': utils.rsa_encrypt(yzm_key, to_json(j)), 'versionKey':
 '2'}
  File "study3.py", line 39, in to_json
    return json.dumps(j, sort_keys=True, separators=(',', ':'))
  File "C:\Users\chenshi\AppData\Local\Programs\Python\Python36\lib\json\__init_
_.py", line 238, in dumps
    **kw).encode(obj)
  File "C:\Users\chenshi\AppData\Local\Programs\Python\Python36\lib\json\encoder
.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Users\chenshi\AppData\Local\Programs\Python\Python36\lib\json\encoder
.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "C:\Users\chenshi\AppData\Local\Programs\Python\Python36\lib\json\encoder
.py", line 180, in default
    o.__class__.__name__)
TypeError: Object of type 'module' is not JSON serializable

然后做题的这一堆接口应该是改了很多。。rsa的key也改掉了。大改

脚本又一次无法使用

新的学期,测试时脚本又一次无法使用
可以登录,可以读取到课程
但选择yes时窗口会一闪而过
没有任何效果

Crashed while 'saving record'

I'm having a problem while running wisdomtree. Maybe it's a bug?

Environment: bash on ubuntu on windows, fresh install. Just followed the instructions listed in readme.
Details:

Traceback (most recent call last):
  File "./study.py", line 95, in <module>
    save_record(section, lesson['chapterId'], lesson['id'])
  File "./study.py", line 86, in save_record
    logger.info(dic['name'] + r.json()['studyPercenter'])
  File "/usr/lib/python3/dist-packages/requests/models.py", line 741, in json
    return json.loads(self.text, **kwargs)
  File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
    raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)

Thanks in advance.

登录状态正常并获取到课程,按下Y键确认开始后,返回错误参数

Traceback (most recent call last):
File "study.py", line 132, in
save_record(section, lesson, True)
File "study.py", line 121, in save_record
rt = post('/student/tutorial/saveLearningRecordByToken', p)
File "study.py", line 27, in post
j = r.json()
File "F:\Python36\lib\site-packages\requests\models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "F:\Python36\lib\json_init_.py", line 354, in loads
return _default_decoder.decode(s)
File "F:\Python36\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "F:\Python36\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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.