Extra media types

master
Bob Mottram 2019-08-30 20:29:26 +01:00
parent 5a7180e040
commit 8379fada03
1 changed files with 10 additions and 0 deletions

View File

@ -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):