mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-10 07:18:33 +00:00
[ie/createacademy] better leading zeros
This commit is contained in:
parent
ba1d60dfd8
commit
6e636bdd4c
@ -28,19 +28,14 @@ class CreateAcademyBaseIE(InfoExtractor):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def _get_lesson_metadata(self, data, lesson_id):
|
def _get_lesson_metadata(self, data, lesson_id):
|
||||||
prefix = 'Create Academy - s' + str(data['props']['course']['id']) + 'e'
|
prefix = 'Create Academy - s' + str(data['props']['course']['id']).zfill(2) + 'e'
|
||||||
|
|
||||||
for section in data['props']['course']['curriculum']['sections']:
|
for section in data['props']['course']['curriculum']['sections']:
|
||||||
for lesson in section['lessons']:
|
for lesson in section['lessons']:
|
||||||
if lesson['id'] == lesson_id:
|
if lesson['id'] == lesson_id:
|
||||||
if lesson['number'] < 10:
|
|
||||||
num = '0' + str(lesson['number'])
|
|
||||||
else:
|
|
||||||
num = str(lesson['number'])
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'section_data': section,
|
'section_data': section,
|
||||||
'title': prefix + num + ' - ' + lesson['title'].strip(),
|
'title': prefix + str(lesson['number']).zfill(2) + ' - ' + lesson['title'].strip(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user