Install:
You can download built binaries for Mac and Linux from the releases page.
Usage:
File:
$ ./detect-media-type ~/out.wav
File MIME type: audio/wav
File size: 589826
URL:
$ ./detect-media-type "https://homepages.cae.wisc.edu/~ece533/images/airplane.png"
Content-Length: 450502
Content-Type: image/png
Detected Content-Type: image/png