diff --git a/coursera/filtering.py b/coursera/filtering.py index 14f4116..4331831 100644 --- a/coursera/filtering.py +++ b/coursera/filtering.py @@ -95,15 +95,15 @@ def find_resources_to_get(lecture, file_formats, resource_filter, ignored_format for fmt, resources in iteritems(lecture): fmt0 = fmt + + short_fmt = None if '.' in fmt: short_fmt = fmt.split('.')[1] - else: - short_fmt = None - if fmt in ignored_formats or short_fmt in ignored_formats: + if fmt in ignored_formats or (short_fmt != None and short_fmt in ignored_formats) : continue - if fmt in file_formats or short_fmt in file_formats or 'all' in file_formats: + if fmt in file_formats or (short_fmt != None and short_fmt in file_formats) or 'all' in file_formats: for r in resources: if resource_filter and r[1] and not re.search(resource_filter, r[1]): logging.debug('Skipping b/c of rf: %s %s',