guessit-io / guessit

GuessIt is a python library that extracts as much information as possible from a video filename.
https://guessit-io.github.io/guessit
GNU Lesser General Public License v3.0
814 stars 92 forks source link

Norwegian(no) NOT working .. Swedish ok - RemoveInvalidLanguages bug or feature? #668

Open raymondsvendsen opened 3 years ago

raymondsvendsen commented 3 years ago

See below for execution of script with output.

It seems Norwegian is removed in the class RemoveInvalidLanguages. common_words has "no" which is also "Norwegian". So Norwegian language is detected, but later removed by this. (Danish is also not working, but not looked into it, Id guess its the same cause)

I have not made a fix, since im not sure how you want it fixed. Not sure removing "no" from common_words is the way to go.

Norwegian NOK:

$  guessit Tiny.World.S01E01-E06.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL/Tiny.World.S01E01.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL.no.srt                                                                                                                                                                                             (INS)  For: Tiny.World.S01E01-E06.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL/Tiny.World.S01E01.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL.no.srt
GuessIt found: {
    "title": "Tiny World",
    "season": 1,
    "episode": 1,
    "episode_title": "NORDiC",
    "screen_size": "1080p",
    "source": "Web",
    "audio_codec": "Dolby Digital Plus",
    "audio_channels": "5.1",
    "video_codec": "H.264",
    "release_group": "DBRETAiL.no",
    "container": "srt",
    "mimetype": "text/plain",
    "type": "episode"
}

Swedish OK:

$  guessit Tiny.World.S01E01-E06.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL/Tiny.World.S01E01.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL.no.srt                                                                                                                                                                                             (INS)  For: Tiny.World.S01E01-E06.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL/Tiny.World.S01E01.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL.no.srt
GuessIt found: {                          
    "title": "Tiny World",                
    "season": 1,                          
    "episode": 1,                         
    "episode_title": "NORDiC",            
    "screen_size": "1080p",               
    "source": "Web",                      
    "audio_codec": "Dolby Digital Plus",  
    "audio_channels": "5.1",              
    "video_codec": "H.264",               
    "release_group": "DBRETAiL",          
    "subtitle_language": "Swedish",       
    "container": "srt",                   
    "mimetype": "text/plain",             
    "type": "episode"                     
}                                         
(venv)  ~/projects/python/rmnamer   mast

Danish NOK:

$  guessit Tiny.World.S01E01-E06.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL/Tiny.World.S01E01.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL.da.srt                                                                                                                                                                                             (INS)  For: Tiny.World.S01E01-E06.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL/Tiny.World.S01E01.NORDiC.1080p.WEB-DL.DDP5.1.H.264-DBRETAiL.da.srt
GuessIt found: {
    "title": "Tiny World",
    "season": 1,
    "episode": 1,
    "episode_title": "NORDiC",
    "screen_size": "1080p",
    "source": "Web",
    "audio_codec": "Dolby Digital Plus",
    "audio_channels": "5.1",
    "video_codec": "H.264",
    "release_group": "DBRETAiL.da",
    "container": "srt",
    "mimetype": "text/plain",
    "type": "episode"
}
Toilal commented 3 years ago

You have to add da inside list of allowed_languages in options.json.

Toilal commented 3 years ago

(For this to work with no, I assume you already removed no from advanced_config.common_words in options.json).