[NFO] Other MPAA certifiaction country

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Rootz
Posts: 7
Joined: 16 Dec 2018, 10:48

[NFO] Other MPAA certifiaction country

Post by Rootz »

Hello

I'm using filebot script to obtain artwork and NFO with this command

Code: Select all

-script fn:artwork.tmdb
Any chance to obtain other mpaa certification from other country, Portugal instead USA?
User avatar
rednoah
The Source
Posts: 23073
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [NFO] Other MPAA certifiaction country

Post 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

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


:idea: 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.
:idea: Please read the FAQ and How to Request Help.
Rootz
Posts: 7
Joined: 16 Dec 2018, 10:48

Re: [NFO] Other MPAA certifiaction country

Post by Rootz »

Thanks for the info but im to noob to make that thing :)
User avatar
rednoah
The Source
Posts: 23073
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [NFO] Other MPAA certifiaction country

Post 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 }"

Code: Select all

M/6 | Avatar (2009)
...

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
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: [NFO] Other MPAA certifiaction country

Post by kim »

Code: Select all

<mpaa></mpaa>
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
Rootz
Posts: 7
Joined: 16 Dec 2018, 10:48

Re: [NFO] Other MPAA certifiaction country

Post by Rootz »

So i fork scripts.
What script i need to edit do get PT certification?
User avatar
rednoah
The Source
Posts: 23073
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [NFO] Other MPAA certifiaction country

Post 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
:idea: Please read the FAQ and How to Request Help.
Rootz
Posts: 7
Joined: 16 Dec 2018, 10:48

Re: [NFO] Other MPAA certifiaction country

Post 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"
Image

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>
User avatar
rednoah
The Source
Posts: 23073
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [NFO] Other MPAA certifiaction country

Post 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.


:arrow: 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 ...

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

Code: Select all

filebot -script dev:nfo ...

:arrow: See documentation for -script fn:name and artwork.tmdb and nfo here:
viewtopic.php?t=5
:idea: Please read the FAQ and How to Request Help.
Rootz
Posts: 7
Joined: 16 Dec 2018, 10:48

Re: [NFO] Other MPAA certifiaction country

Post 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)
User avatar
rednoah
The Source
Posts: 23073
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [NFO] Other MPAA certifiaction country

Post 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.


:arrow: 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>

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


:idea: 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply