From 8379fada034e5084c15c88098d5307e70d4f6893 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 30 Aug 2019 20:29:26 +0100 Subject: [PATCH] Extra media types --- daemon.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/daemon.py b/daemon.py index 47f44920..2ee84e9e 100644 --- a/daemon.py +++ b/daemon.py @@ -281,6 +281,16 @@ class PubServer(BaseHTTPRequestHandler): fileExtension='jpg' if messageJson['object']['attachment'][attachmentIndex]['mediaType'].endswith('gif'): fileExtension='gif' + if messageJson['object']['attachment'][attachmentIndex]['mediaType'].endswith('audio/mpeg'): + fileExtension='mp3' + if messageJson['object']['attachment'][attachmentIndex]['mediaType'].endswith('ogg'): + fileExtension='ogg' + if messageJson['object']['attachment'][attachmentIndex]['mediaType'].endswith('mp4'): + fileExtension='mp4' + if messageJson['object']['attachment'][attachmentIndex]['mediaType'].endswith('webm'): + fileExtension='webm' + if messageJson['object']['attachment'][attachmentIndex]['mediaType'].endswith('ogv'): + fileExtension='ogv' mediaDir=self.server.baseDir+'/accounts/'+self.postToNickname+'@'+self.server.domain uploadMediaFilename=mediaDir+'/upload.'+fileExtension if not os.path.isfile(uploadMediaFilename):