sintonia/python_apps
Lucas Bickel 9ce611130c Use file-magic instead of python-magic
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.
2017-04-18 09:49:09 +02:00
..
airtime-celery use celery 3.0 and compatible kombo 2017-04-13 23:11:59 -04:00
airtime_analyzer Use file-magic instead of python-magic 2017-04-18 09:49:09 +02:00
api_clients Fix recording through ecasound 2017-03-24 15:15:37 +01:00
icecast2 Reverted commit mistakenly changing file modifiers to 755 2015-01-14 20:45:03 -05:00
media-monitor Run build from installer; add upstart files and templating back in 2015-06-30 12:16:31 -04:00
pypo Merge pull request #163 from radiorabe/feature/python-debug-flag-for-140 2017-04-17 16:36:07 -04:00
std_err_override CC-5990, CC-5991 - Python cleanup, removed need for /usr/lib/airtime 2015-01-27 18:43:36 -05:00