Skip to content

Commit

Permalink
修复[BUG](#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samueli924 committed Nov 14, 2023
1 parent bb1a897 commit ebd521c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def get_job_list(self, _clazzid, _courseid, _cpi, _knowledgeid):
return _job_list, _job_info

def get_enc(self, clazzId, jobid, objectId, playingTime, duration, userid):
# https://github.com/ZhyMC/chaoxing-xuexitong-autoflush/blob/445c8d8a8cc63472dd90cdf2a6ab28542c56d93b/logger.js
return md5(
f"[{clazzId}][{userid}][{jobid}][{objectId}][{playingTime * 1000}][d_yHJ!$pdA~5][{duration * 1000}][0_{duration}]"
.encode()).hexdigest()
Expand Down Expand Up @@ -143,10 +142,10 @@ def study_video(self, _course, _job, _job_info, _speed: float = 1):
_session.headers.update()
_info_url = f"https://mooc1.chaoxing.com/ananas/status/{_job['objectid']}?k={self.get_fid()}&flag=normal"
_video_info = _session.get(_info_url).json()
_dtoken = _video_info["dtoken"] # 7d8349c683a65af92b68ed42b9eebfc1
_dtoken = _video_info["dtoken"]
_duration = _video_info["duration"]
_crc = _video_info["crc"] # 993fd31ba058895723016fa4fe9a6486
_key = _video_info["key"] # 71980072a32dd57d151f7c3f6b3b122c
_crc = _video_info["crc"]
_key = _video_info["key"]
_isPassed = False
_isFinished = False
_playingTime = 0
Expand Down
12 changes: 6 additions & 6 deletions api/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ def decode_course_card(_text: str):
_job_list = []
if _cards:
_job_info = {}
_job_info["ktoken"] = _cards["defaults"]["ktoken"] # 0754c189543882e328d711960117de81
_job_info["mtEnc"] = _cards["defaults"]["mtEnc"] # 5a281a5c9819ae54f0b23bf97865133e
_job_info["ktoken"] = _cards["defaults"]["ktoken"]
_job_info["mtEnc"] = _cards["defaults"]["mtEnc"]
_job_info["reportTimeInterval"] = _cards["defaults"]["reportTimeInterval"] # 60
_job_info["defenc"] = _cards["defaults"]["defenc"] # 48a25584121db3161e429c9b0861b3da
_job_info["cardid"] = _cards["defaults"]["cardid"] # 690554045
_job_info["cpi"] = _cards["defaults"]["cpi"] # 82923364
_job_info["qnenc"] = _cards["defaults"]["qnenc"] # a60d09ee89bc30d264e09d24b77e3ada
_job_info["defenc"] = _cards["defaults"]["defenc"]
_job_info["cardid"] = _cards["defaults"]["cardid"]
_job_info["cpi"] = _cards["defaults"]["cpi"]
_job_info["qnenc"] = _cards["defaults"]["qnenc"]
_job_info["ktoken"] = _cards["defaults"]["ktoken"]
_job_info["ktoken"] = _cards["defaults"]["ktoken"]
_job_info["ktoken"] = _cards["defaults"]["ktoken"]
Expand Down

0 comments on commit ebd521c

Please sign in to comment.