mirror of
https://github.com/coursera-dl/coursera-dl.git
synced 2026-01-23 02:35:37 +00:00
add support to download certain subtitle
This commit is contained in:
parent
2ea2e7aa62
commit
eec99f64a4
1 changed files with 4 additions and 4 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue