Fixes Issue #2 #4
@ -64,15 +64,22 @@ class Mediasite:
|
|||||||
os.mkdir(slides_path)
|
os.mkdir(slides_path)
|
||||||
slides = []
|
slides = []
|
||||||
demux_file = os.path.join(slides_path, 'demux.txt')
|
demux_file = os.path.join(slides_path, 'demux.txt')
|
||||||
|
start_time = timedelta(minutes=3, seconds=51, milliseconds=170)
|
||||||
with open(demux_file, 'w') as f:
|
with open(demux_file, 'w') as f:
|
||||||
elapsed = 0
|
elapsed = 0
|
||||||
for slide in data['slides']:
|
myslide = {}
|
||||||
myslide = { 'url': os.path.join(slides_path, self._download(slides_path, slide['url'], session)),
|
for i in range(len(data['slides'])):
|
||||||
'duration': '{}ms'.format(int(slide['duration'])-elapsed)}
|
myslide['url'] = os.path.join(slides_path, self._download(slides_path, data['slide'][i]['url'], session))
|
||||||
|
if i == 0:
|
||||||
|
myslide['duration'] = '{}ms'.format((start_time.total_seconds * 1000) + int(data['slides'][i]['duration']))
|
||||||
|
elapsed = start_time.total_seconds * 1000 + int(data['slides'][i]['duration'])
|
||||||
|
else:
|
||||||
|
myslide['duration'] = '{}ms'.format(int(data['slides'][i]['duration'])-elapsed)
|
||||||
|
elapsed = int(data['slides'][i]['duration'])
|
||||||
|
|
||||||
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)
|
||||||
elapsed = int(slide['duration'])
|
|
||||||
|
|
||||||
# to accomodate for an ffmpeg quirk that needs the last slide twice
|
# to accomodate for an ffmpeg quirk that needs the last slide twice
|
||||||
f.write('file \'{}\'\n'.format(slides[-1]['url']))
|
f.write('file \'{}\'\n'.format(slides[-1]['url']))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user