I have a problem with audios uploaded to libretime that contain white spaces in the name. The file is finally imported in the library but it is marked as “Import failed” which confuse the users. Below the error log:
2017-12-22 09:32:11,053 [message_listener] [INFO ] - Received '{"tmp_file_path":"\/srv\/airtime\/stor\/organize\/example file with spaces full.mp3","storage_backend":"file","import_directory":"\/srv\/airtime\/stor\/\/imported\/6","original_filename":"example file with spaces full.mp3","callback_url":"https:\/\/airtime.97irratia.info\/\/rest\/media\/1225","api_key":"J****QVADGWA1FEBZ1","file_prefix":""}' on routing_key ''
2017-12-22 09:32:11,055 [analyzer_pipeline] [ERROR] [Errno 2] No such file or directory: '/srv/airtime/stor/organize/example file with spaces full.mp3'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/airtime_analyzer-0.1-py2.7.egg/airtime_analyzer/analyzer_pipeline.py", line 70, in run_analysis
metadata = MetadataAnalyzer.analyze(audio_file_path, metadata)
File "/usr/local/lib/python2.7/dist-packages/airtime_analyzer-0.1-py2.7.egg/airtime_analyzer/metadata_analyzer.py", line 32, in analyze
metadata["filesize"] = os.path.getsize(filename)
File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/srv/airtime/stor/organize/example file with spaces full.mp3'
2017-12-22 09:32:11,056 [message_listener] [ERROR] Analyzer pipeline exception: [Errno 2] No such file or directory: '/srv/airtime/stor/organize/example file with spaces full.mp3.mp3'