Page 1 of 1
[NFO] Other MPAA certifiaction country
Posted: 30 Jan 2023, 18:15
by Rootz
Hello
I'm using filebot script to obtain artwork and NFO with this command
Any chance to obtain other mpaa certification from other country, Portugal instead USA?
Re: [NFO] Other MPAA certifiaction country
Posted: 31 Jan 2023, 03:29
by rednoah
No, you cannot modify the NFO template unless you modify the code. Yes, if you fork the scripts and modify the code.
Yes, in custom formats:
Code: Select all
$ filebot -list --q 19995 --db TheMovieDB --format "{ ny } | { info.certifications.PT }"
Avatar (2009) | M/6

MPAA means "Motion Picture Association Of
America" so changing the value of the <mpaa> tag probably wouldn't make sense.

We could add certifications for all countries but I'm not sure if the "standard" for NFO files used by Kodi / Plex / etc has a standardized <tag> for that.
Re: [NFO] Other MPAA certifiaction country
Posted: 31 Jan 2023, 12:25
by Rootz
Thanks for the info but im to noob to make that thing

Re: [NFO] Other MPAA certifiaction country
Posted: 31 Jan 2023, 13:12
by rednoah
You can use
filebot to write a list of all your movies with their corresponding Portuguese certifications. That's quite easy.
e.g. print certifications:
Code: Select all
filebot -mediainfo -r /input --filter movie --format "{ info.certifications.PT } | { movie }"
e.g. write certifications to a text file:
Code: Select all
filebot -mediainfo -r /input --filter movie --format "{ info.certifications.PT } | { movie }" > movie-list.txt
Re: [NFO] Other MPAA certifiaction country
Posted: 31 Jan 2023, 14:28
by kim
Country specific mpaa rating system. Check with skin author which prefix is required to display your country local rating system
https://kodi.wiki/view/NFO_files/Movies
https://kodi.wiki/view/NFO_files/TV_shows
but kodi will only show 1 tag so I combined it like so:
e.g.
Code: Select all
<mpaa>11 (DK) / 11 (SE) / PG (US)</mpaa>
Code: Select all
// Get [filtered] Certifications
def certCountryLIST = ['DK', 'NO', 'SE', 'US']
def CustomCertLIST = i.certifications.findAll{key, value -> certCountryLIST.any{key.contains(it)}}.sort().findResults{key, value -> value + ' ('+key+')'}
mpaa((CustomCertLIST).join(' / '))
viewtopic.php?p=31192#p31192
Re: [NFO] Other MPAA certifiaction country
Posted: 07 Feb 2023, 15:06
by Rootz
So i fork scripts.
What script i need to edit do get PT certification?
Re: [NFO] Other MPAA certifiaction country
Posted: 07 Feb 2023, 15:08
by rednoah
The
nfo.groovy script should get you started.
EDIT:
We've updated the nfo script to write all known certifications to generated nfo files:
https://github.com/filebot/scripts/comm ... a9e7fc6725
Re: [NFO] Other MPAA certifiaction country
Posted: 08 Feb 2023, 12:48
by Rootz
Just tested but only USA rating was writing
Get info by context default scripts.
Code: Select all
@="cmd /c filebot -script fn:artwork.tmdb \"%1\" -non-strict --log-file context.log"
Code: Select all
<movie>
<title>Babylon</title>
<originaltitle>Babylon</originaltitle>
<sorttitle>Babylon :: Babylon :: 2022-12-22</sorttitle>
<set>Babylon</set>
<year>2022</year>
<rating>7.788</rating>
<votes>574</votes>
<mpaa>R</mpaa>
<id>tt10640346</id>
Re: [NFO] Other MPAA certifiaction country
Posted: 08 Feb 2023, 13:26
by rednoah
You are using
-script fn:artwork.tmdb so that does not refer to the nfo script, and wouldn't include the latest changes from yesterday anyway due to
fn:name usage, and isn't the path to the locally modified script that you presumably have cloned / forked / modified to somewhere.

You can call a local custom script by specifying the file path to your local custom script:
Code: Select all
filebot -script /path/to/script.groovy ...

Alternatively, you can use
-script dev:name syntax to fetch a script directly from GitHub:

See documentation for
-script fn:name and
artwork.tmdb and
nfo here:
viewtopic.php?t=5
Re: [NFO] Other MPAA certifiaction country
Posted: 09 Feb 2023, 15:43
by Rootz
I give up!
All commands i do goes to some error.
For this example above, can you tell me what i really need to do? Exact command.
Scripts are in c:\scripts (downloaded last with all commits)
Movie are: c:\alien (1979)
Code: Select all
C:\>FileBot -script c:\scripts\nfo.groovy "c:\Alien (1979)"
[XATTR NOT FOUND] C:\Alien (1979)\Alien.1979.PROPER.REMASTERED.THEATRICAL.1080p.BluRay.x265-RARBG.mp4
Done ?(?????)?
Code: Select all
C:\>filebot -script fn:xattr "c:\Alien (1979)"
C:\Alien (1979)\Alien.1979.PROPER.REMASTERED.THEATRICAL.1080p.BluRay.x265-RARBG.mp4
CRC32: 8D428549
Done ?(?????)?
Code: Select all
C:\>filebot -script C:\scripts\amc.groovy fn:artwork.tmdb "c:\Alien (1979)"
Run script [C:\scripts\amc.groovy] at [Thu Feb 09 15:03:37 WET 2023]
-script C:\scripts\amc.groovy requires FileBot r9500 or higher. You are running FileBot r9125.
Please use -script fn:amc and NOT -script C:\scripts\amc.groovy to ensure compatibility.
Abort (?_?)
Code: Select all
C:\>filebot -script C:\scripts\artwork.tmdb.groovy "c:\Alien (1979)\Alien.1979.PROPER.REMASTERED.THEATRICAL.1080p.BluRay.x265-RARBG.mp4"
No signature of method: net.filebot.web.Movie.isEmpty() is applicable for argument types: () values: []
Possible solutions: identity(groovy.lang.Closure), inspect(), dump()
groovy.lang.MissingMethodException: No signature of method: net.filebot.web.Movie.isEmpty() is applicable for argument types: () values: []
Possible solutions: identity(groovy.lang.Closure), inspect(), dump()
at Script1$_run_closure1.doCall(Script1.groovy:33)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at net.filebot.cli.ScriptShellMethods.eachMediaFolder(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at Script1.run(Script1.groovy:13)
at net.filebot.cli.ScriptShell.evaluate(Unknown Source)
at net.filebot.cli.ScriptShell.runScript(Unknown Source)
at net.filebot.cli.ArgumentProcessor.runScript(Unknown Source)
at net.filebot.cli.ArgumentProcessor.run(Unknown Source)
at net.filebot.Main.main(Unknown Source)
Error (o_O)
Re: [NFO] Other MPAA certifiaction country
Posted: 09 Feb 2023, 16:09
by rednoah
e.g. call latest script revision from GitHub on your sample file:
Code: Select all
filebot -script dev:nfo "C:\Alien (1979)"

If you get
XATTR NOT FOUND then that means that the file at hand does not have
xattr metadata. Your
filebot -script fn:xattr call confirms the
absence of the
net.filebot.metadata attribute.

I recommend
following the example to see what it would look like if the files did have
xattr metadata:
1. FileBot stores
xattr metadata after matching and renaming:
Code: Select all
$ filebot -rename --db TheMovieDB 'Alien (1979)' --log INFO
[MOVE] from [Alien (1979)/Alien.1979.PROPER.REMASTERED.THEATRICAL.1080p.BluRay.x265-RARBG.mp4] to [Alien (1979)/Alien (1979).mp4]
2. Confirm that FileBot did successfully store
xattr metadata:
Code: Select all
$ filebot -script fn:xattr 'Alien (1979)'
Alien (1979)/Alien (1979).mp4
net.filebot.filename: Alien.1979.PROPER.REMASTERED.THEATRICAL.1080p.BluRay.x265-RARBG.mp4
net.filebot.metadata: {"@type":"Movie","year":1979,"imdbId":78748,"tmdbId":348,"language":"en-US","id":348,"name":"Alien","aliasNames":[]}
3. The
nfo script now works on the given files:
Code: Select all
$ filebot -script dev:nfo 'Alien (1979)'
[MOVIE] Alien (1979) [Alien (1979)/Alien (1979).mp4]
Generate Movie NFO: Alien (1979) [Alien (1979)/Alien (1979).nfo]
Code: Select all
<movie>
<title>Alien</title>
...
<certification>
<country>BR</country>
<rating>14</rating>
</certification>
<certification>
<country>US</country>
<rating>R</rating>
</certification>
<certification>
<country>SU</country>
<rating>16+</rating>
</certification>
<certification>
<country>IE</country>
<rating>15</rating>
</certification>
<certification>
<country>NO</country>
<rating>18</rating>
</certification>
<certification>
<country>AU</country>
<rating>M</rating>
</certification>
<certification>
<country>IS</country>
<rating>16</rating>
</certification>
<certification>
<country>ES</country>
<rating>16</rating>
</certification>
<certification>
<country>IN</country>
<rating>A</rating>
</certification>
<certification>
<country>GB</country>
<rating>18</rating>
</certification>
<certification>
<country>PE</country>
<rating>14</rating>
</certification>
<certification>
<country>JP</country>
<rating>PG-12</rating>
</certification>
<certification>
<country>IT</country>
<rating>T</rating>
</certification>
<certification>
<country>FI</country>
<rating>K-16</rating>
</certification>
<certification>
<country>PH</country>
<rating>R-18</rating>
</certification>
<certification>
<country>PT</country>
<rating>M/16</rating>
</certification>
<certification>
<country>AR</country>
<rating>18</rating>
</certification>
<certification>
<country>NZ</country>
<rating>16</rating>
</certification>
<certification>
<country>HU</country>
<rating>18</rating>
</certification>
<certification>
<country>KR</country>
<rating>18</rating>
</certification>
<certification>
<country>TR</country>
<rating>18+</rating>
</certification>
<certification>
<country>CA</country>
<rating>18A</rating>
</certification>
<certification>
<country>SG</country>
<rating>PG</rating>
</certification>
<certification>
<country>PL</country>
<rating>16</rating>
</certification>
<certification>
<country>DK</country>
<rating>15</rating>
</certification>
<certification>
<country>DE</country>
<rating>16</rating>
</certification>
<certification>
<country>GR</country>
<rating>K-16</rating>
</certification>
<certification>
<country>RU</country>
<rating>18+</rating>
</certification>
<certification>
<country>SE</country>
<rating>15</rating>
</certification>
<certification>
<country>FR</country>
<rating>12</rating>
</certification>
<certification>
<country>TH</country>
<rating>18 +</rating>
</certification>
<certification>
<country>NL</country>
<rating>16</rating>
</certification>
...
</movie>

Please double-check your results and see if you get the same as me or different results from me.

If you have trouble with
xattr metadata not working on a given drive or network share, then you may need to configure FileBot to store
xattr metadata into .xattr folders and plain/text files instead of NTFS Alternate Data Streams.