Kodi Community Forum

Full Version: I need help with advancedsettings.xml and cleanstrings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm running Kodi 18.5 on a 64 bit Win7 machine.

I have a few thousand files that I want Kodi to scrape correctly. I generally follow Kodi naming rules but also put additional info inside [brackets] at the end of file names using a batch renamer. The bracketed info seems to confuse the scraper, resulting in less than 50% of files scraping correctly. I want to keep the bracketed info. AFAIK, the cleanstrings regex https://kodi.wiki/view/Advancedsettings....eanstrings has handled this for others.

I created an .xml file in my AppData>Roaming>Kodi>userdata folder named "advancedsettings". The file contains the following:

<advancedsettings version="1.0">
    <video>
    <cleanstrings>
    <regexp>[ _\,\.\(\)\[\]\-](ac3|dts|custom|dc|remastered|divx|divx5|dsr|dsrip|dutch|dvd|dvd5|dvd9|dvdrip|dvdscr|dvdscreener|screener|dvdivx|cam|fragment|fs|hdtv|hdrip|hdtvrip|internal|limited|multisubs|ntsc|ogg|ogm|pal|pdtv|proper|repack|rerip|retail|r3|r5|bd5|se|svcd|swedish|german|read.nfo|nfofix|unrated|extended|ws|telesync|ts|telecine|tc|brrip|bdrip|480p|480i|576p|576i|720p|720i|1080p|1080i|3d|hrhd|hrhdtv|hddvd|bluray|x264|h264|xvid|xvidvd|xxx|www.www|cd[1-9]|\[.*\])([ _\,\.\(\)\[\]\-]|$)</regexp>
    <regexp>(\[.*\])</regexp>
    </cleanstrings>
    </video>
 </advancedsettings>

My understanding was that this would hide the brackets, everything inside the brackets, and everything to the right of the brackets in the file names when scraping. It seems to do nothing for me though. In Kodi, the unrecognized files show their original file names while recognized files show with their library names. Manually scanning an unrecognized file after deleting the brackets and bracketed info causes it to scrape correctly (almost always). I deleted my Kodi library data and re-scraped after adding the advancedsettings.xml file. I searched all settings for a toggle but found none.

I'm stumped. Does Kodi 18.5 not use this method anymore? Is there a setting I need to use? Is my advancedsettings.xml file incorrect? I'm not a coder, but if you give me monkey instructions I should be able to follow them. Thanks.
Post a full Debug Log which captures you scraping your movies. I can then see if the advancedsettings.xml file is being loaded and if there is another problem at play with the scraping.
(2020-02-18, 01:24)Karellen Wrote: [ -> ]Post a full Debug Log which captures you scraping your movies. I can then see if the advancedsettings.xml file is being loaded and if there is another problem at play with the scraping.
Thank you! I ran "scan for new content" on a folder and here is a link to the log file: https://paste.kodi.tv/peginunugi . I didn't delete the library first though; I'm not sure if that matters.
Ok, I see a few problems...

1. smb://XPSSERVER/Drive.1/Alt_MOVIES/Ghost.in.the.Shell/Ghost.in.the.Shell_S.A.C..1st.GIG_2002-2003/' as not in the database
This is a TV Show, but you have it in Movies and are trying to scrape it as a movie. It won't work.

2. Disable Item 1d as described here... https://forum.kodi.tv/showthread.php?tid=336969

3. Alt_MOVIES/Berserk_The.Golden.Age.Arc_2012-2014/Berserk_-_Golden_Age_Chapter_III_-_Advent.mkv
If you need to have the strange naming that you are trying to overcome with the advancedsettings.xml file, then...
a. In your Set Content screen for your Source, enable the setting Movies are in separate folders that match the movie title https://kodi.wiki/view/Adding_video_sources#Set_Content
b. name your video file with whatever name you need
c. Name the movie folder correctly. So it will look like the following
Alt_MOVIES/Berserk The Golden Age Arc III - The Advent (2013)/Berserk_-_Golden_Age_Chapter_III_-_Advent name it with anything you want..mkv

The setting in 3a tells Kodi to ignore the filename and use the foldername for lookups.

Some of the links in My Signature below may be of use to you.
(2020-02-18, 03:18)Karellen Wrote: [ -> ]Ok, I see a few problems...

1. smb://XPSSERVER/Drive.1/Alt_MOVIES/Ghost.in.the.Shell/Ghost.in.the.Shell_S.A.C..1st.GIG_2002-2003/' as not in the database
This is a TV Show, but you have it in Movies and are trying to scrape it as a movie. It won't work.

2. Disable Item 1d as described here... https://forum.kodi.tv/showthread.php?tid=336969

3. Alt_MOVIES/Berserk_The.Golden.Age.Arc_2012-2014/Berserk_-_Golden_Age_Chapter_III_-_Advent.mkv
If you need to have the strange naming that you are trying to overcome with the advancedsettings.xml file, then...
a. In your Set Content screen for your Source, enable the setting Movies are in separate folders that match the movie title https://kodi.wiki/view/Adding_video_sources#Set_Content
b. name your video file with whatever name you need
c. Name the movie folder correctly. So it will look like the following
Alt_MOVIES/Berserk The Golden Age Arc III - The Advent (2013)/Berserk_-_Golden_Age_Chapter_III_-_Advent name it with anything you want..mkv

The setting in 3a tells Kodi to ignore the filename and use the foldername for lookups.

Some of the links in My Signature below may be of use to you.
Thank you. I realize there are some files that I haven't organized or labeled correctly yet, but those are a small minority of the problem files and not the subject I'm trying to address. Examples of the problem I'm trying to address would be:
5.Centimeters.Per.Second_2007.[1920x1080_HEVC_744mb]
Anima_2019.[1920x1080_AVC_686mb]
Bleach_2018.[1920x1080_AVC_4455mb]
Halo_Legends_2010.[1920x816_AVC_1966mb]
Heavy.Metal_1981.[1920x1040_HEVC_1429mb]
Isle.of.Dogs_2018.[1920x800_AVC_3804mb]
Jack.and.the.Cuckoo-clock.Heart_2013.[1920x1040_AVC_4471mb]
Jin-Roh.(The.Wolf.Brigade)_1999.[1920x1080_HEVC_1780mb]
MFKZ_2018.[1916x800_AVC_3148mb]
... etc., which will scan without bracket info.

And then there are files like:
Mary.and.Max_2009.[1920x1040_HEVC_2058mb]
Pink.Floyd_The.Wall_1982.[1920x800_HEVC_1596mb]
Summer.Wars_2009.[1280x720_AVC_2577mb]
... etc., which won't scan at all.

Do you see ANY instances of the cleanstrings regex working?
None of those movies are in the log, so I could not check, but the log won't show if the regex is working on Movies. All I can check is if the advancedsettings.xml is being loaded. But I don't think the regex is working because the scraper is searching for Find movie with title 'Bleach 2018' from year '1920'

Are those folder names or filenames? If they are filenames, then use the method I described above. If they are both, bite the bullet and use the method I described above.

I have had a quick play and could not get your regex to work, but this not something I would spend anymore time trying to fault find. Our stance is that you name your files correctly, if you are trying to do something different, you are pretty much on your own or if any other community member has had success, they can help out.

As you have discovered, once you use correct naming, it all works. Sorry I cannot be of more help.

Moved to Information Provider forum.
(2020-02-18, 04:36)Karellen Wrote: [ -> ] 

The regex I used is not mine - it is copied directly from the Kodi wiki and is described as being for this purpose.  Apparently it doesn't work.  That's too bad, because putting precise file data in brackets at the end of filenames is a common practice.  And without a flat file structure, that file data is not convenient to reference through File Explorer.

It would be very helpful to many users for Kodi's cleanstrings regex to work.  I hate to think I might simply be using it incorrectly, but I can't tell.  If someone at Kodi takes an interest in solving this issue, I hope I will be notified.

Thank you for your time.