devsnd / cherrymusic

Stream your own music collection to all your devices! The easy to use free and open-source music streaming server.
http://www.fomori.org/cherrymusic
GNU General Public License v3.0
1.03k stars 189 forks source link

Issue playing songs with Japanese characters in filename. #701

Closed vhodh closed 6 years ago

vhodh commented 6 years ago

Hello.

I am having an issue with playback on files with Japanese characters in their filename. No issue with those characters in metadata, it seems. During setup all transcoding dependencies show up as available and active.

Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy-11.1.0-py3.6.egg\cherrypy\_cprequest.py", line 634, in respond
    self._do_respond(path_info)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy-11.1.0-py3.6.egg\cherrypy\_cprequest.py", line 693, in _do_respond
    response.body = self.handler()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy-11.1.0-py3.6.egg\cherrypy\lib\encoding.py", line 221, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy-11.1.0-py3.6.egg\cherrypy\_cpdispatch.py", line 60, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "C:\Program Files\CherryMusic\cherrymusicserver\httphandler.py", line 257, in trans
    path = codecs.decode(codecs.encode(path, 'latin1'), 'utf-8')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 53-61: ordinal not in range(256)
[171108-18:05] 127.0.0.1 - - [08/Nov/2017:18:05:32] "GET /trans/mp3/Hiroshi Satoh\Hiroshi Sato - AQUA (1988) [FLAC]\13 - \xe8\xa8\x98\xe6\x86\xb6\xe3\x81\xae\xe4\xb8\xad\xe3\x81\xae\xe6\x9c\xaa\xe6\x9d\xa5\xe3\x81\x8b\xe3\x82\x89 [Bonus Tracks].flac?bitrate=0 HTTP/1.1" 500 824 "http://127.0.0.1:7070/" "Mozilla
/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.40 Safari/537.36"

All songs from this particular album play fine until the last track which includes aforementioned characters. Title should be: "13 - 記憶の中の未来から [Bonus Tracks]".

I believe I grabbed the correct traceback, but if more information is needed please let me know. Thank you!

Windows 10 Python 3.6.3 Flac 1.3.2