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 33bbfcc commit bb1a897
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ def decode_course_point(_text):
_soup = BeautifulSoup(_text, "lxml")
_course_point = {}
_point_list = []
_course_point["finish_num"] = _soup.select_one("div.chapter_head h2.xs_head_name span").text
_course_point["total_num"] = re.findall("/(\d{1,10})", _soup.select_one("div.chapter_head h2.xs_head_name").text)[0]

_raw_points = _soup.select("div.chapter_item")
for _point in _raw_points:
if (not "id" in _point.attrs) or (not "title" in _point.attrs):
Expand All @@ -56,6 +53,8 @@ def decode_course_card(_text: str):
else:
return None
_cards = json.loads("{" + _temp + "}")
_job_info = {}
_job_list = []
if _cards:
_job_info = {}
_job_info["ktoken"] = _cards["defaults"]["ktoken"] # 0754c189543882e328d711960117de81
Expand Down

0 comments on commit bb1a897

Please sign in to comment.