mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-11-16 10:32:40 +09:00
[udemy] Use chapter_number
This commit is contained in:
parent
306c51c669
commit
5bafcf6525
@ -245,7 +245,7 @@ class UdemyCourseIE(UdemyIE):
|
|||||||
course_id, 'Downloading course curriculum')
|
course_id, 'Downloading course curriculum')
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
chapter, chapter_id = None, None
|
chapter, chapter_number = None, None
|
||||||
for asset in response:
|
for asset in response:
|
||||||
asset_type = asset.get('assetType') or asset.get('asset_type')
|
asset_type = asset.get('assetType') or asset.get('asset_type')
|
||||||
if asset_type == 'Video':
|
if asset_type == 'Video':
|
||||||
@ -256,13 +256,13 @@ class UdemyCourseIE(UdemyIE):
|
|||||||
'url': 'https://www.udemy.com/%s/#/lecture/%s' % (course_path, asset['id']),
|
'url': 'https://www.udemy.com/%s/#/lecture/%s' % (course_path, asset['id']),
|
||||||
'ie_key': UdemyIE.ie_key(),
|
'ie_key': UdemyIE.ie_key(),
|
||||||
}
|
}
|
||||||
if chapter_id:
|
if chapter_number:
|
||||||
entry['chapter_id'] = chapter_id
|
entry['chapter_number'] = chapter_number
|
||||||
if chapter:
|
if chapter:
|
||||||
entry['chapter'] = chapter
|
entry['chapter'] = chapter
|
||||||
entries.append(entry)
|
entries.append(entry)
|
||||||
elif asset.get('type') == 'chapter':
|
elif asset.get('type') == 'chapter':
|
||||||
chapter_id = asset.get('index') or asset.get('object_index')
|
chapter_number = asset.get('index') or asset.get('object_index')
|
||||||
chapter = asset.get('title')
|
chapter = asset.get('title')
|
||||||
|
|
||||||
return self.playlist_result(entries, course_id, course_title)
|
return self.playlist_result(entries, course_id, course_title)
|
||||||
|
Loading…
Reference in New Issue
Block a user