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