diff --git a/iiify/resolver.py b/iiify/resolver.py index 54e233b..5335a6d 100644 --- a/iiify/resolver.py +++ b/iiify/resolver.py @@ -50,7 +50,10 @@ def to_mimetype(format): "h.264 MPEG4": "video/mpeg", "h.264": "video/mpeg", "Matroska": "video/x-matroska", - "Cinepack": "video/x-msvideo" + "Cinepack": "video/x-msvideo", + "AIFF": "audio/aiff", + "Apple Lossless Audio": "audio/x-m4a", + "MPEG-4 Audio": "audio/mp4" } return formats.get(format, "application/octet-stream") @@ -388,7 +391,7 @@ def create_manifest3(identifier, domain=None, page=None): originals.append(f) # create the canvases for each original - for file in [f for f in originals if f['format'] in ['VBR MP3', '32Kbps MP3', '56Kbps MP3', '64Kbps MP3', '96Kbps MP3', '128Kbps MP3', 'Flac', 'Ogg Vorbis', 'WAVE', '24bit Flac', 'Shorten']]: + for file in [f for f in originals if f['format'] in ['VBR MP3', '32Kbps MP3', '56Kbps MP3', '64Kbps MP3', '96Kbps MP3', '128Kbps MP3', 'MPEG-4 Audio', 'Flac', 'AIFF', 'Apple Lossless Audio', 'Ogg Vorbis', 'WAVE', '24bit Flac', 'Shorten']]: normalised_id = file['name'].rsplit(".", 1)[0] slugged_id = normalised_id.replace(" ", "-") c_id = f"https://iiif.archivelab.org/iiif/{identifier}/{slugged_id}/canvas" @@ -402,7 +405,7 @@ def create_manifest3(identifier, domain=None, page=None): if file['name'] in derivatives: body = Choice(items=[]) # add the choices in order per https://github.com/ArchiveLabs/iiif.archivelab.org/issues/77#issuecomment-1499672734 - for format in ['VBR MP3', '32Kbps MP3', '56Kbps MP3', '64Kbps MP3', '96Kbps MP3', '128Kbps MP3', 'Flac', 'Ogg Vorbis', 'WAVE', '24bit Flac', 'Shorten']: + for format in ['VBR MP3', '32Kbps MP3', '56Kbps MP3', '64Kbps MP3', '96Kbps MP3', '128Kbps MP3', 'MPEG-4 Audio', 'Flac', 'AIFF', 'Apple Lossless Audio', 'Ogg Vorbis', 'WAVE', '24bit Flac', 'Shorten']: if format in derivatives[file['name']]: r = ResourceItem(id=f"https://archive.org/download/{identifier}/{derivatives[file['name']][format]['name'].replace(' ', '%20')}", type='Audio',