ratoaq2 / knowit

Know better your media files
MIT License
29 stars 5 forks source link

Error opening files with special chars (aka Umlaute) #57

Closed desmoloch closed 1 year ago

desmoloch commented 1 year ago

Hi, i´m using pymedusa with knowit included. While parsing my files containing special chars (like ä or ö) i get the following error:

+-------------------------------------------------------+ KnowIt 0.4.0 +-------------------------------------------------------+ pymediainfo
libmediainfo.so.0
v21.9
ffprobe
v4.4.1
enzyme
0.4.2

+-------------------------------------------------------+ | profile: default | +-------------------------------------------------------+ Traceback (most recent call last): File "/app/medusa/ext/knowit/api.py", line 59, in know result = provider.describe(video_path, context) File "/app/medusa/ext/knowit/providers/mediainfo.py", line 284, in describe data = self.executor.extract_info(video_path) File "/app/medusa/ext/knowit/providers/mediainfo.py", line 91, in extract_info return self._execute(filename) File "/app/medusa/ext/knowit/providers/mediainfo.py", line 157, in _execute return json.loads(MediaInfo.parse(filename, library_file=self.location, output='JSON')) File "/app/medusa/ext/pymediainfo/init.py", line 496, in parse raise RuntimeError( RuntimeError: An error occured while opening /mnt/TV/Deadbeat/Staffel 2/Deadbeat - 2x06 - Der Fall der Fälle.mkv with libmediainfo

ratoaq2 commented 1 year ago

Could you try to reproduce it using knowit alone (in a command line outside medusa)? There might be changes to environment variables or python environment in medusa that could lead to this, therefore you should try first check if this is indeed an issue with knowit.

When I try something myself here using special chars, I'm able to get results without issues:

$ knowit "/storage/temp/Deadbeat - 2x06 - Der Fall der Fälle.mkv"
For: /storage/temp/Deadbeat - 2x06 - Der Fall der Fälle.mkv
Knowit 0.5.1 found:
{
    "title": "Redacted",
    "path": "/storage/temp/Deadbeat - 2x06 - Der Fall der Fälle.mkv",
    "duration": "2:06:55",
    "size": "11.40 MB",
    "bit_rate": "12.0 Kbps",
    "container": "mkv",
    "subtitle": [
        {
            "id": 1,
            "name": "Some Name Here",
            "language": "English",
            "format": "PGS"
        }
    ],
    "provider": {
        "name": "mediainfo",
        "version": {
            "pymediainfo": "6.0.1",
            "libmediainfo.so.0": "v20.9"
        }
    }
}

If there's an issue, then I would ask you to try with latest knowit version

desmoloch commented 1 year ago

I tried Version 0.5.2 and 0.4.0 on my windows machine and its working fine. Atm i cant start a bash on my docker container, still trying to find out why...

desmoloch commented 1 year ago

Must be a problem with my docker container. Tried another docker and different LANG and LANGUAGES env´s, still not working. But no issue with knowit :) Closed!