1 parent 47111df commit cf275b5Copy full SHA for cf275b5
2 files changed
config_template.ini
@@ -5,8 +5,8 @@ username = xxx
5
; 登录密码(必填)
6
password = xxx
7
8
-; 要学习的课程ID列表, 逗号隔开(选填)
9
-course_list = [xxx,xxx,xxx,xxx,xxx]
+; 要学习的课程ID列表, 逗号隔开(选填,不需要则留空)
+course_list = xxx,xxx,xxx
10
11
; 视频播放倍速(默认1,最大2)
12
speed = 1
main.py
@@ -1,7 +1,6 @@
1
# -*- coding: utf-8 -*-
2
import argparse
3
import configparser
4
-
from api.logger import logger
from api.base import Chaoxing, Account
from api.exceptions import LoginError, FormatError
@@ -20,7 +19,7 @@ def init_config():
20
19
config.read(args.config, encoding="utf8")
21
return (config.get("common", "username"),
22
config.get("common", "password"),
23
- config.get("common", "course_list"),
+ str(config.get("common", "course_list")).split(",") if config.get("common", "course_list") else None,
24
int(config.get("common", "speed")))
25
else:
26
return (args.username, args.password, args.list.split(",") if args.list else None, int(args.speed) if args.speed else 1)
0 commit comments