[dl:http] add MIME type and signature for .aac files

This commit is contained in:
Mike Fährmann
2025-12-29 19:05:34 +01:00
parent c2917ad5c5
commit c8c4575c7f
2 changed files with 5 additions and 0 deletions

View File

@@ -484,6 +484,8 @@ MIME_TYPES = {
"audio/webm" : "webm",
"audio/ogg" : "ogg",
"audio/mpeg" : "mp3",
"audio/aac" : "aac",
"audio/x-aac": "aac",
"application/vnd.apple.mpegurl": "m3u8",
"application/x-mpegurl" : "m3u8",
@@ -540,6 +542,7 @@ SIGNATURE_CHECKS = {
s[8:12] == b"WAVE"),
"mp3" : lambda s: (s[0:3] == b"ID3" or
s[0:2] in (b"\xFF\xFB", b"\xFF\xF3", b"\xFF\xF2")),
"aac" : lambda s: s[0:2] in (b"\xFF\xF9", b"\xFF\xF1"),
"m3u8": lambda s: s[0:7] == b"#EXTM3U",
"mpd" : lambda s: b"<MPD" in s,
"zip" : lambda s: s[0:4] in (b"PK\x03\x04", b"PK\x05\x06", b"PK\x07\x08"),

View File

@@ -395,6 +395,8 @@ SAMPLES = {
("mp3" , b"\xFF\xFB"),
("mp3" , b"\xFF\xF3"),
("mp3" , b"\xFF\xF2"),
("aac" , b"\xFF\xF9"),
("aac" , b"\xFF\xF1"),
("m3u8", b"#EXTM3U\n#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000"),
("mpd" , b'<MPD xmlns="urn:mpeg:dash:schema:mpd:2011"'),
("zip" , b"PK\x03\x04"),