INNER CODE UNIT · Python
_is_video_method
Nour833/StegoForge · web/app.py:53
def _is_video_method(method: str | None) -> bool:
return method in {"video-dct", "video-motion"}
# Magic bytes → (mime, extension)
_MAGIC_MAP = [
(b"\x89PNG", "image/png", ".png"),
(b"\xff\xd8\xff", "image/jpeg", ".jpg"),
(b"GIF8", "image/gif", ".gif"),
(b"BM", "image/bmp", ".bmp"),
(b"II*\x00", "image/tiff", ".tiff"),
(b"MM\x00*", "image/tiff", ".tiff"),
(b"RIFF", "audio/wav", ".wav"),
(b"ID3", "audio/mpeg", ".mp3"),
(b"\xff\xfb", "audio/mpeg", ".mp3"),
(b"fLaC", "audio/flac", ".flac"),
(b"OggS", "audio/ogg", ".ogg"),
(b"\x00\x00\x00", None, None), # placeholder (mp4 check below)