mirror of
https://github.com/coursera-dl/coursera-dl.git
synced 2026-01-23 02:35:37 +00:00
Add --specialization flag to expand specialization names only when explicitly requested
This is because there are clashes in course and specialization names. For example, "machine-learning" is both a course and a specialization name. These are different courses from different universities (!).
This commit is contained in:
parent
b505983263
commit
d95d0573bb
2 changed files with 12 additions and 1 deletions
|
|
@ -125,6 +125,16 @@ def parse_args(args=None):
|
|||
group_material = parser.add_argument_group(
|
||||
'Selection of material to download')
|
||||
|
||||
group_material.add_argument(
|
||||
'--specialization',
|
||||
dest='specialization',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='treat given class names as specialization names and try to '
|
||||
'download its courses, if available. Note that there are name '
|
||||
'clashes, e.g. "machine-learning" is both a course and a '
|
||||
'specialization (Default: False)')
|
||||
|
||||
group_material.add_argument(
|
||||
'--only-syllabus',
|
||||
dest='only_syllabus',
|
||||
|
|
|
|||
|
|
@ -234,7 +234,8 @@ def main():
|
|||
|
||||
session = get_session()
|
||||
login(session, args.username, args.password)
|
||||
args.class_names = expand_specializations(session, args.class_names)
|
||||
if args.specialization:
|
||||
args.class_names = expand_specializations(session, args.class_names)
|
||||
|
||||
for class_index, class_name in enumerate(args.class_names):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue