Fixes Issue #2 #4

Merged
dafo5502 merged 59 commits from developer into master 2021-10-25 14:41:37 +02:00
Showing only changes of commit 345be98371 - Show all commits

View File

@ -74,6 +74,8 @@ class Mediasite:
# loop all slides and download, calculate the duration and create a text file holding all the info for he ffmpeg demuxer # loop all slides and download, calculate the duration and create a text file holding all the info for he ffmpeg demuxer
for i in range(num_slides): for i in range(num_slides):
myslide['url'] = os.path.join(slides_path, self._download(slides_path, data['slides'][i]['url'], session)) myslide['url'] = os.path.join(slides_path, self._download(slides_path, data['slides'][i]['url'], session))
# Handle the different edgecases for indiviual slide duration
if i == num_slides - 1: if i == num_slides - 1:
myslide['duration'] = '{}ms'.format(data['duration'] - int(data['slides'][i]['duration'])) myslide['duration'] = '{}ms'.format(data['duration'] - int(data['slides'][i]['duration']))
elif i == 0: elif i == 0:
@ -81,6 +83,7 @@ class Mediasite:
else: else:
myslide['duration'] = '{}ms'.format(int(data['slides'][i+1]['duration']) - int(data['slides'][i]['duration'])) myslide['duration'] = '{}ms'.format(int(data['slides'][i+1]['duration']) - int(data['slides'][i]['duration']))
# Commit to the demuxfile
f.write('file \'{}\'\n'.format(myslide['url'])) f.write('file \'{}\'\n'.format(myslide['url']))
f.write('duration {}\n'.format(myslide['duration'])) f.write('duration {}\n'.format(myslide['duration']))
slides.append(myslide) slides.append(myslide)