Merge 89ca9f8f67
into d65d89183f
This commit is contained in:
commit
fe47ce5d0c
|
@ -310,7 +310,23 @@ class LyndaCourseIE(LyndaBaseIE):
|
|||
|
||||
unaccessible_videos = 0
|
||||
entries = []
|
||||
|
||||
template_vars = {}
|
||||
date = course.get('DateReleasedUtc')
|
||||
if isinstance(date, str) and len(date) > 10:
|
||||
date = date[6:10] + date[0:2] + date[3:5]
|
||||
template_vars.update({'release_date': date})
|
||||
|
||||
authors = course.get("Authors")
|
||||
if authors and isinstance(authors, list):
|
||||
author_string = ''
|
||||
for author in authors:
|
||||
if isinstance(author, dict):
|
||||
name = author.get("Fullname")
|
||||
if isinstance(name, str) and name:
|
||||
author_string += name + ", "
|
||||
author_string = author_string[:-2]
|
||||
template_vars.update({'creator': author_string})
|
||||
# Might want to extract videos right here from video['Formats'] as it seems 'Formats' is not provided
|
||||
# by single video API anymore
|
||||
|
||||
|
@ -321,14 +337,16 @@ class LyndaCourseIE(LyndaBaseIE):
|
|||
continue
|
||||
video_id = video.get('ID')
|
||||
if video_id:
|
||||
entries.append({
|
||||
entry = {
|
||||
'_type': 'url_transparent',
|
||||
'url': item_template % video_id,
|
||||
'ie_key': LyndaIE.ie_key(),
|
||||
'chapter': chapter.get('Title'),
|
||||
'chapter_number': int_or_none(chapter.get('ChapterIndex')),
|
||||
'chapter_id': compat_str(chapter.get('ID')),
|
||||
})
|
||||
}
|
||||
entry.update(template_vars)
|
||||
entries.append(entry)
|
||||
|
||||
if unaccessible_videos > 0:
|
||||
self._downloader.report_warning(
|
||||
|
|
Loading…
Reference in New Issue