1
0
mirror of synced 2024-11-21 16:54:23 +01:00

Add support for AIFF files

This should close #151
This commit is contained in:
jvoisin 2021-04-24 17:26:38 +02:00
parent c5841a241d
commit 85c08c5b68
3 changed files with 22 additions and 0 deletions

View File

@ -90,3 +90,14 @@ class WAVParser(video.AbstractFFmpegParser):
'FileSize', 'FileType', 'FileTypeExtension',
'MIMEType', 'NumChannels', 'SampleRate', 'SourceFile',
}
class AIFFParser(video.AbstractFFmpegParser):
mimetypes = {'audio/aiff', 'audio/x-aiff'}
meta_allowlist = {'AvgBytesPerSec', 'BitsPerSample', 'Directory',
'Duration', 'Encoding', 'ExifToolVersion',
'FileAccessDate', 'FileInodeChangeDate',
'FileModifyDate', 'FileName', 'FilePermissions',
'FileSize', 'FileType', 'FileTypeExtension',
'MIMEType', 'NumChannels', 'SampleRate', 'SourceFile',
'NumSampleFrames', 'SampleSize',
}

BIN
tests/data/dirty.aiff Normal file

Binary file not shown.

View File

@ -230,6 +230,11 @@ class TestGetMeta(unittest.TestCase):
p = images.SVGParser('./tests/data/weird.svg')
self.assertEqual(p.get_meta()['Xmlns'], 'http://www.w3.org/1337/svg')
def test_aiff(self):
p = audio.AIFFParser('./tests/data/dirty.aiff')
meta = p.get_meta()
self.assertEqual(meta['Name'], 'I am so')
class TestRemovingThumbnails(unittest.TestCase):
def test_odt(self):
@ -312,6 +317,12 @@ class TestCleaning(unittest.TestCase):
'meta': {'Comment': 'Zomg, a comment!'},
'expected_meta': {},
}, {
'name': 'aiff',
'parser': audio.AIFFParser,
'meta': {'Annotation': 'Thank you for using MAT !'},
'expected_meta': {},
},
{
'name': 'mp3',
'parser': audio.MP3Parser,
'meta': {'TXXX:I am a': 'various comment'},