add support to download certain subtitle

This commit is contained in:
孙业军 2017-03-10 14:35:53 +08:00
parent 2ea2e7aa62
commit eec99f64a4

View file

@ -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',