Skip to content

Commit cf275b5

Browse files
committed
修复[BUG](Samueli924#295)
1 parent 47111df commit cf275b5

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

config_template.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ username = xxx
55
; 登录密码(必填)
66
password = xxx
77

8-
; 要学习的课程ID列表, 逗号隔开(选填)
9-
course_list = [xxx,xxx,xxx,xxx,xxx]
8+
; 要学习的课程ID列表, 逗号隔开(选填,不需要则留空)
9+
course_list = xxx,xxx,xxx
1010

1111
; 视频播放倍速(默认1,最大2)
1212
speed = 1

main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22
import argparse
33
import configparser
4-
54
from api.logger import logger
65
from api.base import Chaoxing, Account
76
from api.exceptions import LoginError, FormatError
@@ -20,7 +19,7 @@ def init_config():
2019
config.read(args.config, encoding="utf8")
2120
return (config.get("common", "username"),
2221
config.get("common", "password"),
23-
config.get("common", "course_list"),
22+
str(config.get("common", "course_list")).split(",") if config.get("common", "course_list") else None,
2423
int(config.get("common", "speed")))
2524
else:
2625
return (args.username, args.password, args.list.split(",") if args.list else None, int(args.speed) if args.speed else 1)

0 commit comments

Comments
 (0)