{"success":true,"data":{"ext":"m3u","name":"M3U","description":"M3U is a plain-text playlist file format originally created for Winamp and now supported by many media players and streaming applications. It is used to list local media files or network streams, making it common for audio playlists, internet radio, and IPTV channel lists. The format is simple and generally safe, though playlists can reference remote resources or invalid paths, so files from untrusted sources should be reviewed carefully.","mime":["audio/x-mpegurl"],"risk_level":"Safe","signatures":[{"hex":"23 45 58 54 4D 33 55 0D 0A","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"23 45 58 54 4D 33 55","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]}],"related":["m3u8"],"usage":{"python":"def is_m3u(file_path: str) -> bool:\n    \"\"\"Check if file is a valid M3U by magic bytes.\"\"\"\n    signature = bytes([0x23, 0x45, 0x58, 0x54, 0x4D, 0x33, 0x55, 0x0D, 0x0A])\n    with open(file_path, \"rb\") as f:\n        return f.read(9) == signature","node":"function isM3U(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x23, 0x45, 0x58, 0x54, 0x4D, 0x33, 0x55, 0x0D, 0x0A]);\n  return buffer.subarray(0, 9).equals(signature);\n}","go":"func IsM3U(data []byte) bool {\n    signature := []byte{0x23, 0x45, 0x58, 0x54, 0x4D, 0x33, 0x55, 0x0D, 0x0A}\n    if len(data) < 9 {\n        return false\n    }\n    return bytes.Equal(data[:9], signature)\n}"},"category":"Audio"}}