jkwill87 / mnamer

media file renaming and organizing tool
https://pypi.org/project/mnamer
MIT License
792 stars 67 forks source link

Language issue #95

Open zwgtdev opened 4 years ago

zwgtdev commented 4 years ago

Heya, Having an odd issue on the latest version where it is crashing complaining about the language it seems, any ideas around this one?

============================== CRASH REPORT BEGIN ==============================

--------------------------------- environment ----------------------------------

 - date = 2020-07-10
 - platform = Linux-5.4.0-40-generic-x86_64-with-glibc2.29
 - arguments = ['-r', '/media/jag/Eric/DL_Complete/', '-v']
 - python version = 3.8.2
 - mnamer version = 2.4.1
 - requests cache = /home/jag/.cache/mnamer-py3.8.sql

--------------------------------- stack trace ----------------------------------

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/babelfish/converters/__init__.py", line 157, in convert
    return self.to_symbol[alpha3]
KeyError: 'mul'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jag/Dev/python/mnamer-master/mnamer/__main__.py", line 22, in main
    frontend = Cli(settings)
  File "/home/jag/Dev/python/mnamer-master/mnamer/frontends.py", line 67, in __init__
    super().__init__(settings)
  File "/home/jag/Dev/python/mnamer-master/mnamer/frontends.py", line 25, in __init__
    self.targets = Target.populate_paths(self.settings)
  File "/home/jag/Dev/python/mnamer-master/mnamer/target.py", line 61, in populate_paths
    targets = [cls(file_path, settings) for file_path in file_paths]
  File "/home/jag/Dev/python/mnamer-master/mnamer/target.py", line 61, in <listcomp>
    targets = [cls(file_path, settings) for file_path in file_paths]
  File "/home/jag/Dev/python/mnamer-master/mnamer/target.py", line 47, in __init__
    self._parse(file_path)
  File "/home/jag/Dev/python/mnamer-master/mnamer/target.py", line 122, in _parse
    path_data[k] = Language.parse(v)
  File "/home/jag/Dev/python/mnamer-master/mnamer/language.py", line 48, in parse
    return cls(value.name, value.alpha2, value.alpha3)
  File "/usr/local/lib/python3.8/dist-packages/babelfish/language.py", line 150, in __getattr__
    return language_converters[name].convert(alpha3, country, script)
  File "/usr/local/lib/python3.8/dist-packages/babelfish/converters/__init__.py", line 159, in convert
    raise LanguageConvertError(alpha3, country, script)
babelfish.exceptions.LanguageConvertError: mul

=============================== CRASH REPORT END ===============================
jkwill87 commented 4 years ago

I just added language support so there might be a few rough edges to smooth out. mnamer should just ideally ignore languages it can't recognize, not crash. If you can run find . -type f -name '*.mp4' -or -name '*.mkv' -or -name '*.srt' in that directory to get a listing of the files it was trying to process that could be helpful in identifying which file it got hung up on. Thanks.

zwgtdev commented 4 years ago

Sure thing, this is what I have in the directory:

$ find . -type f -name '*.mp4' -or -name '*.mkv' -or -name '*.srt'
./Babysplitters.2020.1080p.WEB-DL.DD5.1.H.264-EVO/Babysplitters.2020.1080p.WEB-DL.DD5.1.H.264-EVO.mkv
SweetthD3ViL commented 3 years ago

Hello jkwill87,

I also have the same issue - below the crash report and the listing of file that mnamer is trying to handle.


============================== CRASH REPORT BEGIN ==============================

--------------------------------- environment ----------------------------------

 - date = 2020-11-17
 - platform = Linux-4.4.238-1-ARCH-armv5tel-with-glibc2.4
 - arguments = ['-bvr', '/mnt/hd/Download/']
 - cache location = /home/sweetth/.cache/mnamer-py3.8.sql
 - python version = 3.8.6
 - mnamer version = 2.4.2
 - appdirs version = 1.4.4
 - babelfish version = 0.5.5-dev
 - guessit version = 3.1.0
 - requests version = 2.24.0
 - requests cache version = 0.5.2
 - teletype version = 1.0.4

--------------------------------- stack trace ----------------------------------

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/babelfish/converters/__init__.py", line 157, in convert
    return self.to_symbol[alpha3]
KeyError: 'mul'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sweetth/.local/lib/python3.8/site-packages/mnamer/__main__.py", line 22, in main
    frontend = Cli(settings)
  File "/home/sweetth/.local/lib/python3.8/site-packages/mnamer/frontends.py", line 67, in __init__
    super().__init__(settings)
  File "/home/sweetth/.local/lib/python3.8/site-packages/mnamer/frontends.py", line 25, in __init__
    self.targets = Target.populate_paths(self.settings)
  File "/home/sweetth/.local/lib/python3.8/site-packages/mnamer/target.py", line 62, in populate_paths
    targets = [cls(file_path, settings) for file_path in file_paths]
  File "/home/sweetth/.local/lib/python3.8/site-packages/mnamer/target.py", line 62, in <listcomp>
    targets = [cls(file_path, settings) for file_path in file_paths]
  File "/home/sweetth/.local/lib/python3.8/site-packages/mnamer/target.py", line 45, in __init__          
    self._parse(file_path)                                                                                
  File "/home/sweetth/.local/lib/python3.8/site-packages/mnamer/target.py", line 131, in _parse           
    path_data[k] = Language.parse(v)                                                                      
  File "/home/sweetth/.local/lib/python3.8/site-packages/mnamer/language.py", line 47, in parse           
    return cls(value.name, value.alpha2, value.alpha3)                                                    
  File "/usr/lib/python3.8/site-packages/babelfish/language.py", line 150, in __getattr__                 
    return language_converters[name].convert(alpha3, country, script)                                     
  File "/usr/lib/python3.8/site-packages/babelfish/converters/__init__.py", line 159, in convert          
    raise LanguageConvertError(alpha3, country, script)                                                   
babelfish.exceptions.LanguageConvertError: mul                                                            

=============================== CRASH REPORT END ===============================
$ find . -type f -name '*.mp4' -or -name '*.mkv' -or -name '*.srt'
./Dr.Stone.S01E01.CUSTOM.MULTi.1080p.BluRay.x264-NoTag.mkv
./Dr.Stone.S01E02.CUSTOM.MULTi.1080p.BluRay.x264-NoTag.mkv
./Dr.STONE.S01E05.FRENCH.1080p.WEB-DL.H264-.mkv
./Dr.STONE.E08.FRENCH.1080p.WEB.x264-RiPiT.mkv
./Dr.Stone.S01E03.CUSTOM.MULTi.1080p.BluRay.x264-NoTag.mkv
./Dr.STONE.S01E06.FRENCH.1080p.WEB-DL.H264-.mkv
./Dr.STONE.E07.FRENCH.1080p.WEB.x264-RiPiT.mkv
./Dr.Stone.S01E04.CUSTOM.MULTi.1080p.BluRay.x264-NoTag.mkv
m4dm4rtig4n commented 3 years ago

Same error with file : Songbird.2020.MULTi.1080p.HDLight.x264.AC3-EXTREME_wWw.Extreme-Down.TV.mkv