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 79aa76f106 - Show all commits

View File

@ -3,6 +3,7 @@ import json
import os
import re
import shutil
import logging
import requests
from requests.auth import HTTPBasicAuth
@ -23,6 +24,7 @@ class Mediasite:
config['mediasite']['password'])
self.chunk_size = 10485760 # 10MiB; seems optimal for speed
# Tested 8k, 10MiB and 20MiB
self.logger = logging.getLogger('play-daemon')
def pack(self, pres_id, queue_item):
data = queue_item['data']
@ -64,10 +66,11 @@ class Mediasite:
demux_file = os.path.join(slides_path, 'demux.txt')
with open(demux_file, 'w') as f:
for slide in data['slides']:
self.logger.info('Slide: {}'.format(slide))
myslide = { 'url': os.path.join(slides_path, self._download(slides_path, slide['url'], session)),
'duration': slide['time'] }
'duration': slide['duration'] }
f.write('file \'{}\'\n'.format(myslide['url']))
f.write('duration {}\n'.format(slide['time']))
f.write('duration {}\n'.format(slide['duration']))
mypackage['slides'].append(myslide)
# to accomodate for an ffmpeg quirk that needs the last slide twice