parent
c5841a241d
commit
85c08c5b68
@ -90,3 +90,14 @@ class WAVParser(video.AbstractFFmpegParser):
|
|||||||
'FileSize', 'FileType', 'FileTypeExtension',
|
'FileSize', 'FileType', 'FileTypeExtension',
|
||||||
'MIMEType', 'NumChannels', 'SampleRate', 'SourceFile',
|
'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
BIN
tests/data/dirty.aiff
Normal file
Binary file not shown.
@ -230,6 +230,11 @@ class TestGetMeta(unittest.TestCase):
|
|||||||
p = images.SVGParser('./tests/data/weird.svg')
|
p = images.SVGParser('./tests/data/weird.svg')
|
||||||
self.assertEqual(p.get_meta()['Xmlns'], 'http://www.w3.org/1337/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):
|
class TestRemovingThumbnails(unittest.TestCase):
|
||||||
def test_odt(self):
|
def test_odt(self):
|
||||||
@ -312,6 +317,12 @@ class TestCleaning(unittest.TestCase):
|
|||||||
'meta': {'Comment': 'Zomg, a comment!'},
|
'meta': {'Comment': 'Zomg, a comment!'},
|
||||||
'expected_meta': {},
|
'expected_meta': {},
|
||||||
}, {
|
}, {
|
||||||
|
'name': 'aiff',
|
||||||
|
'parser': audio.AIFFParser,
|
||||||
|
'meta': {'Annotation': 'Thank you for using MAT !'},
|
||||||
|
'expected_meta': {},
|
||||||
|
},
|
||||||
|
{
|
||||||
'name': 'mp3',
|
'name': 'mp3',
|
||||||
'parser': audio.MP3Parser,
|
'parser': audio.MP3Parser,
|
||||||
'meta': {'TXXX:I am a': 'various comment'},
|
'meta': {'TXXX:I am a': 'various comment'},
|
||||||
|
Loading…
Reference in New Issue
Block a user