From 13b8a18e21c2eb22302254c3ff23e5d9795e266b Mon Sep 17 00:00:00 2001 From: no Date: Thu, 7 Jan 2016 09:32:50 -0500 Subject: [PATCH] detect webm/mp4 and set mime type correctly --- contrib/tools/archive/nntparchive/archiver.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/tools/archive/nntparchive/archiver.py b/contrib/tools/archive/nntparchive/archiver.py index b5dbdb5..3ba4e95 100755 --- a/contrib/tools/archive/nntparchive/archiver.py +++ b/contrib/tools/archive/nntparchive/archiver.py @@ -83,7 +83,10 @@ class Article: msg += '\n' msg += self.message() + '\n' msg += '--{}\n'.format(self.boundary) - msg += 'Content-Type: image/{}\n'.format(self.j['ext']) + mtype = 'image' + if self.j['ext'] in ['.mp4', '.webm']: + mtype = 'video' + msg += 'Content-Type: {}/{}\n'.format(mtype, self.j['ext']) msg += 'Content-Disposition: form-data; filename="{}{}"; name="import"\n'.format(self.j['filename'], self.j['ext']) msg += 'Content-Transfer-Encoding: base64\n' msg += '\n'