This gets the mime type using file-magic in a most minimal way. Since the python bindings have been available as a distro package for quite a while it is written in a way so it should also run on pre pypi installs of file-magic. This means not being able to use nice things like magic.detect_from_filename due to the fact that they where added rather recently (with recently being 2 years ago). As the mime type is only used to check for wav files that mutagen can't handle it only reads the mime type and ignores the charset and other attributes that magic can find. Due to the fact that file-magic is not properly unicode safe I'm checking the file based on it's first 2048 bytes as per <http://stackoverflow.com/questions/34836792/python-magic-cant-identify-unicode-filename#comment57418632_34838355>. This is not an issue since wav files need to start with a wav header by definition anyway. I tested this sucessfully on both CentOS and Debian with files containing Unicode in their names. |
||
---|---|---|
.. | ||
__init__.py | ||
airtime_analyzer.py | ||
analyzer.py | ||
analyzer_pipeline.py | ||
cloud_storage_uploader.py | ||
cloud_storage_uploader_libcloud.py | ||
config_file.py | ||
cuepoint_analyzer.py | ||
filemover_analyzer.py | ||
message_listener.py | ||
metadata_analyzer.py | ||
playability_analyzer.py | ||
replaygain_analyzer.py | ||
status_reporter.py |