Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增添支持对'基础性作业'的下载 #12

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/tchMaterial-parser.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def parse(url): # 解析 URL
}
"""
# 其中 $.ti_items 的每一项对应一个电子课本
response = requests.get(f"https://s-file-1.ykt.cbern.com.cn/zxx/ndrv2/resources/tch_material/details/{contentId}.json", proxies={ "http": None, "https": None })
if "syncClassroom/basicWork/detail" in url: # 对于“基础性作业”的解析
response = requests.get(f"https://s-file-1.ykt.cbern.com.cn/zxx/ndrs/special_edu/resources/details/{contentId}.json", proxies={ "http": None, "https": None })
else: # 对于课本的解析
response = requests.get(f"https://s-file-1.ykt.cbern.com.cn/zxx/ndrv2/resources/tch_material/details/{contentId}.json", proxies={ "http": None, "https": None })
data = json.loads(response.text)
for item in list(data["ti_items"]):
if item["lc_ti_format"] == "pdf": # 找到存有 PDF 链接列表的项
Expand Down
Loading