Page 3 of 4
Re: please is there any way to use TheMovieDb for series?
Posted: 20 Oct 2018, 06:50
by rednoah
cafevincent wrote: ↑19 Oct 2018, 21:11
would you please send me your bitcoin address, I would like to send you a few "beers" as thanks!
Noice! w00t w00t for kim!

Re: please is there any way to use TheMovieDb for series?
Posted: 20 Oct 2018, 17:59
by kim
Well if you like that, this will blow your mind
Now with TV (series and episode) OMDB (IMDB) support
CLI version:
Code: Select all
{def season = (any{special ? 0 : s} {s}); def episode = (any{special ? special : e} {e}); def eAddOns = ['append_to_response':'external_ids']; def sAddOns = ['append_to_response':'external_ids,content_ratings']; def episodeInfo = net.filebot.WebServices.TheMovieDB.request(\"tv/${id}/season/${season}/episode/${episode}\", eAddOns, Locale.US); def seriesInfo = net.filebot.WebServices.TheMovieDB.request(\"tv/${id}\", sAddOns, Locale.US); def epRating = episodeInfo.vote_average; def epImdbId = episodeInfo.external_ids.imdb_id; def sImdbId = seriesInfo.external_ids.imdb_id; def OMDbEpisodeInfo = (epImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':epImdbId]) : null; def OMDbSeriesInfo = (sImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':sImdbId]) : null; def epOMDbVotes = any{OMDbEpisodeInfo.imdbVotes as int}{null}; def sOMDbVotes = any{OMDbSeriesInfo.imdbVotes.replaceAll(/\D/) as int}{null}; def sTvdbId = any{seriesInfo.external_ids.tvdb_id as int}{null}; def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; def mpaaCountryLIST = ['FI', 'US']; def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{it.rating}.last()}{''}; (allOf{ny}{s00e00}{t}{any{tvdbInfo.genres}{OMDbEpisodeInfo.Genre.split(',')}}{any{mpaaRating}{OMDbSeriesInfo.Rated}{'NR'}}{'r'+any{epOMDbVotes >= 5 ? OMDbEpisodeInfo.imdbRating : null}{sOMDbVotes >= 5 ? OMDbSeriesInfo.imdbRating : null}{(episodeInfo.vote_count as int) >= 5 ? epRating.round(1) : null}{' '}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}
GUI version:
Code: Select all
{def season = (any{special ? 0 : s} {s});
def episode = (any{special ? special : e} {e});
def eAddOns = ['append_to_response':'external_ids'];
def sAddOns = ['append_to_response':'external_ids,content_ratings'];
def episodeInfo = net.filebot.WebServices.TheMovieDB.request("tv/${id}/season/${season}/episode/${episode}", eAddOns, Locale.US);
def seriesInfo = net.filebot.WebServices.TheMovieDB.request("tv/${id}", sAddOns, Locale.US);
def epRating = episodeInfo.vote_average;
def epImdbId = episodeInfo.external_ids.imdb_id;
def sImdbId = seriesInfo.external_ids.imdb_id;
def OMDbEpisodeInfo = (epImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':epImdbId]) : null;
def OMDbSeriesInfo = (sImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':sImdbId]) : null;
def epOMDbVotes = any{OMDbEpisodeInfo.imdbVotes as int}{null};
def sOMDbVotes = any{OMDbSeriesInfo.imdbVotes.replaceAll(/\D/) as int}{null};
def sTvdbId = any{seriesInfo.external_ids.tvdb_id as int}{null};
def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null;
def mpaaCountryLIST = ['FI', 'US'];
def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{it.rating}.last()}{''};
(allOf{ny}{s00e00}{t}{any{tvdbInfo.genres}{OMDbEpisodeInfo.Genre.split(',')}}{any{mpaaRating}{OMDbSeriesInfo.Rated}{'NR'}}{'r'+any{epOMDbVotes >= 5 ? OMDbEpisodeInfo.imdbRating : null}{sOMDbVotes >= 5 ? OMDbSeriesInfo.imdbRating : null}{(episodeInfo.vote_count as int) >= 5 ? epRating.round(1) : null}{' '}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}
TVDB alternative:
Code: Select all
{(allOf{ny}{s00e00}{t}{genres}{any{certification}{omdb.Certification}{'NR'}}{'r'+any{omdb.votes >= 5 ? omdb.rating : null}{votes >= 5 ? rating : null}{' '}}{vf}{vc}{ac}{any{'tt'+(omdb.ImdbId).pad(7)}{''}}).join(' ')}
I do not have a bitcoin wallet, but you can give it to charity of your choice

Re: please is there any way to use TheMovieDb for series?
Posted: 21 Oct 2018, 01:19
by kim
TVDB alternative version 2:
CLI version:
Code: Select all
{import net.filebot.Cache; def epId = net.filebot.WebServices.TheTVDB.getEpisodeList(id, null, Locale.US).find{it =~ sxe || it =~ it.special}.id; def epTVDbInfo = (epId != null) ? net.filebot.WebServices.TheTVDB.requestJson(\"episodes/${epId}\", Locale.US, Cache.ONE_WEEK).data : null; def epImdbId = epTVDbInfo.imdbId; def OMDbEpisodeInfo = (epImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':epImdbId]) : null; def epOMDbVotes = any{OMDbEpisodeInfo.imdbVotes as int}{null}; (allOf{ny}{s00e00}{t}{genres}{any{certification}{omdb.Certification.replaceAll(/N\/A/)}{'NR'}}{'r'+any{epOMDbVotes >= 5 ? OMDbEpisodeInfo.imdbRating : null}{omdb.votes >= 5 ? omdb.rating : null}{votes >= 5 ? rating : null}{' '}}{vf}{vc}{ac}{any{epImdbId}{OMDbEpisodeInfo.imdbID}{'tt'+(omdb.ImdbId).pad(7)}{''}}).join(' ')}
GUI version:
Code: Select all
{import net.filebot.Cache;
def epId = net.filebot.WebServices.TheTVDB.getEpisodeList(id, null, Locale.US).find{it =~ sxe || it =~ it.special}.id;
def epTVDbInfo = (epId != null) ? net.filebot.WebServices.TheTVDB.requestJson("episodes/${epId}", Locale.US, Cache.ONE_WEEK).data : null;
def epImdbId = epTVDbInfo.imdbId;
def OMDbEpisodeInfo = (epImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':epImdbId]) : null;
def epOMDbVotes = any{OMDbEpisodeInfo.imdbVotes as int}{null};
(allOf{ny}{s00e00}{t}{genres}{any{certification}{omdb.Certification.replaceAll(/N\/A/)}{'NR'}}{'r'+any{epOMDbVotes >= 5 ? OMDbEpisodeInfo.imdbRating : null}{omdb.votes >= 5 ? omdb.rating : null}{votes >= 5 ? rating : null}{' '}}{vf}{vc}{ac}{any{epImdbId}{OMDbEpisodeInfo.imdbID}{'tt'+(omdb.ImdbId).pad(7)}{''}}).join(' ')}
sample result:
Firefly (2002) S01E01 The Train Job [Drama Science-Fiction] TV-14 r8.5 tt0579539
Firefly (2002) S01E02 Bushwhacked [Drama Science-Fiction] TV-14 r8.6 tt0579528
Firefly (2002) S01E03 Our Mrs. Reynolds [Drama Science-Fiction] TV-14 r9.1 tt0579532
Firefly (2002) S01E04 Jaynestown [Drama Science-Fiction] TV-14 r8.8 tt0579530
Firefly (2002) S01E05 Out of Gas [Drama Science-Fiction] TV-14 r9.4 tt0579533
Firefly (2002) S01E06 Shindig [Drama Science-Fiction] TV-14 r8.5 tt0579537
Firefly (2002) S01E07 Safe [Drama Science-Fiction] TV-14 r8.3 tt0579534
Firefly (2002) S01E08 Ariel [Drama Science-Fiction] TV-14 r9.1 tt0579527
Firefly (2002) S01E09 War Stories [Drama Science-Fiction] TV-14 r8.9 tt0579541
Firefly (2002) S01E10 Objects in Space [Drama Science-Fiction] TV-14 r9.3 tt0579531
Firefly (2002) S01E11 Serenity [Drama Science-Fiction] TV-14 r8.7 tt0579535
Firefly (2002) S01E12 Heart of Gold [Drama Science-Fiction] TV-14 r8.4 tt0579529
Firefly (2002) S01E13 Trash [Drama Science-Fiction] TV-14 r8.9 tt0579540
Firefly (2002) S01E14 The Message [Drama Science-Fiction] TV-14 r8.5 tt0579538
Firefly (2002) S00E01 Serenity [Drama Science-Fiction] TV-14 r9.0 tt0303461
Firefly (2002) S00E03 Done the Impossible [Drama Science-Fiction] TV-14 r9.0 tt0303461
Firefly (2002) S00E02 Here's How It Was: The Making of "Firefly" [Drama Science-Fiction] TV-14 r9.0 tt0303461
Firefly (2002) S00E04 Browncoats Unite [Drama Science-Fiction] TV-14 r9.0 tt0303461
Re: please is there any way to use TheMovieDb for series?
Posted: 21 Oct 2018, 10:15
by cafevincent
so.. OMDb has the same exact ratings as IMDb because they have been copied over when IMDb used to have an API? then how come they have the same rating for modern shows? and if the ratings are simply copied (no site votes) then how can you set it to 5 votes minimum? would that mean we are requiring the original IMDb rating + 4 OMDb site votes from the days it was possible to vote on the site? unless when they copied the info from IMDb they also included the amount of votes there? also, shouldn't some of the votes be slightly different if there has been OMDb site votes on top of the IMDb ones? ANY information about the benefits of these new ones would be greatly appreciated!
none of that matters, really, since it seems to work nicely (only worried if the 5 vote minimum is needed with OMDb), and I much more appreciate the IMDb ratings. this is truly amazing, really. my eyes nearly bolted out of my head when I saw the results!
Re: please is there any way to use TheMovieDb for series?
Posted: 21 Oct 2018, 18:06
by kim
OMDb gets new info from IMDB, both old and new Movies / TV shows (series and episodes)
How often ?
Don't know, but my guess is 1 x week and older stuff 1 x month/year ?
If they use an API or scrap the info, I don't know.... but it works

maybe they use
https://www.imdb.com/interfaces/
Test it out here:
http://www.omdbapi.com/
Re: please is there any way to use TheMovieDb for series?
Posted: 04 Nov 2018, 12:26
by cafevincent
for some series this produces a `N/A` certification, which divides the first half of the resulting filename into a directory name and and the second half to the filename.
plus could you please build one that renames movies via omdb?
Re: please is there any way to use TheMovieDb for series?
Posted: 04 Nov 2018, 17:35
by kim
cafevincent wrote: ↑04 Nov 2018, 12:26
for some series this produces a `N/A` certification, which divides the first half of the resulting filename into a directory name and and the second half to the filename.
I need a sample ?
renames movies via omdb
why is there a need for this ?
sample ?
you can just use:
Re: please is there any way to use TheMovieDb for series?
Posted: 04 Nov 2018, 19:30
by cafevincent
try fetching `Psychoville (2009) - S01E01 - Black Mail.mkv` to get the `N/A` to appear.
for movies I am hoping for the possibility to get the certification from omdb, they have wider range of countries for the country list. I am currently using the simple omdb.certification but it has the same `N/A` problem for some files.
Re: please is there any way to use TheMovieDb for series?
Posted: 05 Nov 2018, 03:55
by kim
Code: Select all
{OMDbSeriesInfo.Rated.replaceAll(/N\/A/)}
if you need to escape it then
Code: Select all
{OMDbSeriesInfo.Rated.replaceAll(/N\\/A/)}
Sound like you want this:
Code: Select all
def certifications = net.filebot.WebServices.TheMovieDB.getMovieInfo(movie, Locale.US, true).certifications
e.g.
sample from Avatar:
K-13
all available from:
GB=12A, DE=12, ES=7, NZ=M, AU=M, KR=12, GR=Κ-13, ZA=13M-LV, DK=15, KZ=Б14, NL=12, HU=16, BR=10, CA=PG, CH=12, SE=11, CZ=U, RU=16+, IT=T, BG=PG-13, FI=K-13, PT=M/6, BE=12-KT, US=PG-13, FR=10
Re: please is there any way to use TheMovieDb for series?
Posted: 05 Nov 2018, 13:47
by cafevincent
psychoville now works, but I only now started to wonder... why is OMDb giving no cert or rating for this show (not even for one episode) when IMDb does have all the info, including episode level id, ratings?
I'm still trying to figure out what you mean by the `def certification` customization...
Re: please is there any way to use TheMovieDb for series?
Posted: 05 Nov 2018, 15:19
by kim
from
http://www.omdbapi.com/
Code: Select all
{"Title":"Blackmail","Year":"2009","Rated":"N/A","Released":"18 Jun 2009","Season":"N/A","Episode":"N/A","Runtime":"N/A","Genre":"Comedy, Horror, Mystery","Director":"Matt Lipsey","Writer":"Steve Pemberton, Reece Shearsmith","Actors":"Sally Sanders, Reece Shearsmith, Dawn French, Freddie Fruitcake","Plot":"One by one, people in different English counties receive the same grim, succinct, chilling note 'I know what you did'. They seem to have nothing in common, usually doing badly. A blind ...","Language":"N/A","Country":"N/A","Awards":"N/A","Poster":"http://ia.media-imdb.com/images/M/MV5BMTEyNzg5MzQxNjReQTJeQWpwZ15BbWU3MDY1Njg3ODM@._V1_SX300.jpg","Ratings":[{"Source":"Internet Movie Database","Value":"7.2/10"}],"Metascore":"N/A","imdbRating":"7.2","imdbVotes":"83","imdbID":"tt1443130","seriesID":"N/A","Type":"episode","Response":"True"}
maybe rednoah can answer why missing info and outdated e.g. imdbVotes (current = 152) ?
Re: please is there any way to use TheMovieDb for series?
Posted: 05 Nov 2018, 15:47
by rednoah
OMDb ≠ IMDb
It's not the same. Presumably, OMDb regularly scrapes IMDb web pages to collect data, but probably not too regularly as to avoid getting sued by whoever owns IMDb.
Re: please is there any way to use TheMovieDb for series?
Posted: 05 Nov 2018, 18:26
by cafevincent
well this particular show is a (2009) show
Re: please is there any way to use TheMovieDb for series?
Posted: 05 Nov 2018, 18:29
by rednoah
There's a good chance that the last time this particular show was scraped, something went wrong, and hence the bad data.
Re: please is there any way to use TheMovieDb for series?
Posted: 06 Nov 2018, 11:02
by cafevincent
rednoah wrote: ↑05 Nov 2018, 15:47
OMDb ≠ IMDb
It's not the same. Presumably, OMDb regularly scrapes IMDb web pages to collect data, but probably not too regularly as to avoid getting sued by whoever owns IMDb.
that would be Amazon.
Re: please is there any way to use TheMovieDb for series?
Posted: 06 Nov 2018, 14:33
by cafevincent
this is what I gathered you meant with your certification for movies
Code: Select all
-rename
--db
TheMovieDb
--format
"{def certifications = net.filebot.WebServices.TheMovieDB.getMovieInfo(movie, Locale.US, true).certifications; (allOf{ny}{director}{omdb.genres}{any{OMDb.certifications.FI.replaceAll(/N\\/A/)}{OMDb.certifications.US.replaceAll(/N\\/A/)}{'NR'}}{'r'+any{omdb.rating}{' '}}{vf}{vc}{ac}{imdbid}).join(' ')}"
seems to work nicely, but can we do this with omdb instead? I assume they have the whole imdb certifications list. I tried replacing the .themoviedb. bit with .omdb. but it stopped working.
instead of my FI, US only thing I was thinking it would be more accurate and informative (not to mention universal) to have the certifications data...
GB=12A, DE=12, ES=7, NZ=M, AU=M, KR=12, GR=Κ-13, ZA=13M-LV, DK=15, KZ=Б14, NL=12, HU=16, BR=10, CA=PG, CH=12, SE=11, CZ=U, RU=16+, IT=T, BG=PG-13, FI=K-13, PT=M/6, BE=12-KT, US=PG-13, FR=10
...be stripped down to numerals and calculated into an average value, rounded to the closest full number. the few alphabetical-only certifications being ignored. these here 20 (numeral) certifications would average to 12.1 = k12. unless it's too complex?
Re: please is there any way to use TheMovieDb for series?
Posted: 06 Nov 2018, 17:47
by kim
OMDb does NOT have other then US "Rated":
Code: Select all
{"Title":"Avatar","Year":"2009","Rated":"PG-13","Released":"18 Dec 2009","Runtime":"162 min","Genre":"Action, Adventure, Fantasy","Director":"James Cameron","Writer":"James Cameron","Actors":"Sam Worthington, Zoe Saldana, Sigourney Weaver, Stephen Lang","Plot":"A paraplegic marine dispatched to the moon Pandora on a unique mission becomes torn between following his orders and protecting the world he feels is his home.","Language":"English, Spanish","Country":"UK, USA","Awards":"Won 3 Oscars. Another 85 wins & 128 nominations.","Poster":"https://m.media-amazon.com/images/M/MV5BMTYwOTEwNjAzMl5BMl5BanBnXkFtZTcwODc5MTUwMw@@._V1_SX300.jpg","Ratings":[{"Source":"Internet Movie Database","Value":"7.8/10"},{"Source":"Rotten Tomatoes","Value":"82%"},{"Source":"Metacritic","Value":"83/100"}],"Metascore":"83","imdbRating":"7.8","imdbVotes":"1,003,716","imdbID":"tt0499549","Type":"movie","DVD":"22 Apr 2010","BoxOffice":"$749,700,000","Production":"20th Century Fox","Website":"http://www.avatarmovie.com/","Response":"True"}
TheMovieDB is WAY better:
Code: Select all
{def certifications = net.filebot.WebServices.TheMovieDB.getMovieInfo(movie, Locale.US, true).certifications;
def cleanNum = certifications.findResults{key, value -> value.replaceAll(/\D/)}.findAll{it}*.toInteger();
def int avg = (cleanNum.sum() / cleanNum.size()).toDouble().round();
(allOf{ny}{director}{any{omdb.genres}{genres}}{any{'K-'+avg}{certifications.FI}{certifications.US}{'NR'}}{'r'+any{omdb.rating}{rating}{' '}}{vf}{vc}{ac}{imdbid}).join(' ')}
sample (fake file):
Avatar (2009) James Cameron [Action, Adventure, Fantasy] K-12 r7.8 tt0499549
PS: I don't think it will work well with e.g. "For all ages" cert.
e.g. Cinderella 1950 = K-3
https://en.wikipedia.org/wiki/Finnish_B ... sification
so maybe use
or
Re: please is there any way to use TheMovieDb for series?
Posted: 06 Nov 2018, 18:00
by cafevincent
I get error:
Code: Select all
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <>> at index 54: def cleanNum = certifications.findResults{key, value -> value.replaceAll(\D\)}.findAll{it}*.toInteger(); (def cleanNum = certifications.findResults{key, value -> value.replaceAll(\D\)}.findAll{it}*.toInteger();)
Illegal Argument: java.nio.file.InvalidPathException: Trailing char < > at index 29: def int avg = (cleanNum.sum() \ cleanNum.size()).toDouble().round(); (def int avg = (cleanNum.sum() \ cleanNum.size()).toDouble().round();)
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <"> at index 171: (allOf{ny}{director}{any{omdb.genres}{genres}}{any{'c'+avg}{certifications.FI}{certifications.US}{'NR'}}{'r'+any{omdb.rating}{rating}{' '}}{vf}{vc}{ac}{imdbid}).join(' ')}" ((allOf{ny}{director}{any{omdb.genres}{genres}}{any{'c'+avg}{certifications.FI}{certifications.US}{'NR'}}{'r'+any{omdb.rating}{rating}{' '}}{vf}{vc}{ac}{imdbid}).join(' ')}")
SyntaxError: missing token: }
javax.script.ScriptException: SyntaxError: missing token: }
at net.filebot.format.ExpressionFormat.compile(ExpressionFormat.java:112)
at net.filebot.format.ExpressionFormat.<init>(ExpressionFormat.java:43)
at net.filebot.format.ExpressionFileFormat.<init>(ExpressionFileFormat.java:13)
at net.filebot.cli.ArgumentBean.getExpressionFileFormat(ArgumentBean.java:252)
at net.filebot.cli.ArgumentProcessor.runCommand(ArgumentProcessor.java:115)
at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:32)
at net.filebot.Main.main(Main.java:131)
Re: please is there any way to use TheMovieDb for series?
Posted: 06 Nov 2018, 18:12
by rednoah
Looks like a command-line issue:
viewtopic.php?f=4&t=1899

Use the
@file syntax for reading command-line arguments from external text files.
Re: please is there any way to use TheMovieDb for series?
Posted: 06 Nov 2018, 18:13
by kim
I post in GUI format, you need to remember (learn) to escape stuff before use in CLI
SyntaxError: missing token: }
javax.script.ScriptException: SyntaxError: missing token: }
Code: Select all
{def certifications = net.filebot.WebServices.TheMovieDB.getMovieInfo(movie, Locale.US, true).certifications; def cleanNum = certifications.findResults{key, value -> value.replaceAll('\\D')}.findAll{it}*.toInteger(); def int avg = any{(cleanNum.sum() / cleanNum.size()).toDouble().round()}{}; (allOf{ny}{director}{any{omdb.genres}{genres}}{any{avg == 0 ? 'S' : avg >= 5 ? 'K-'+avg : null}{certifications.FI}{certifications.US}{'NR'}}{'r'+any{omdb.Rating}{rating}{' '}}{vf}{vc}{ac}{imdbid}).join(' ')}
Re: please is there any way to use TheMovieDb for series?
Posted: 06 Nov 2018, 18:48
by cafevincent
well now I get this error
Code: Select all
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedConstructor$1 (file:/C:/Program%20Files/FileBot/jar/groovy.jar) to constructor java.math.BigDecimal(java.math.BigInteger,long,int,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedConstructor$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
even though the file gets renamed correctly, seemingly.
Re: please is there any way to use TheMovieDb for series?
Posted: 07 Nov 2018, 13:53
by rednoah
You can ignore these Groovy / Java 9+ warning messages.
Re: please is there any way to use TheMovieDb for series?
Posted: 07 Nov 2018, 18:59
by cafevincent
testing on a massive scale now. at least one interesting popped up:
https://www.themoviedb.org/movie/11324- ... uage=en-US
this movie gets a certification of 99, meaning it probably counts the 16/14 from Switzerland as 1614, not a separate number.
btw this average certification is awesome, finally a definitive indicator!
Re: please is there any way to use TheMovieDb for series?
Posted: 07 Nov 2018, 21:11
by kim
simple fix
Code: Select all
def cleanNum = certifications.findResults{key, value -> value.replaceAll('\\D')}.findAll{it}*.toInteger().findAll{it < 22};
Re: please is there any way to use TheMovieDb for series?
Posted: 08 Nov 2018, 13:05
by cafevincent
the series version did a weird thing today. it renamed the whole season 2 of "F is for Family" so that there were no brackets around the genres. weird right?
this is the one I'm currently using
Code: Select all
-rename
--db
TheMovieDB::TV
--format
"{def season = (any{special ? 0 : s} {s}); def episode = (any{special ? special : e} {e}); def eAddOns = ['append_to_response':'external_ids']; def sAddOns = ['append_to_response':'external_ids,content_ratings']; def episodeInfo = net.filebot.WebServices.TheMovieDB.request("tv/${id}/season/${season}/episode/${episode}", eAddOns, Locale.US); def seriesInfo = net.filebot.WebServices.TheMovieDB.request("tv/${id}", sAddOns, Locale.US); def epRating = episodeInfo.vote_average; def epImdbId = episodeInfo.external_ids.imdb_id; def sImdbId = seriesInfo.external_ids.imdb_id; def OMDbEpisodeInfo = (epImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':epImdbId]) : null; def OMDbSeriesInfo = (sImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':sImdbId]) : null; def epOMDbVotes = any{OMDbEpisodeInfo.imdbVotes as int}{null}; def sOMDbVotes = any{OMDbSeriesInfo.imdbVotes.replaceAll(/D/) as int}{null}; def sTvdbId = any{seriesInfo.external_ids.tvdb_id as int}{null}; def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; def mpaaCountryLIST = ['FI', 'US']; def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{it.rating}.last()}{''}; (allOf{ny}{s00e00}{t}{any{OMDbEpisodeInfo.Genre}{tvdbInfo.genres}}{any{mpaaRating}{OMDbSeriesInfo.Rated.replaceAll(/N\\/A/)}{'NR'}}{'r'+any{epOMDbVotes >= 5 ? OMDbEpisodeInfo.imdbRating : null}{sOMDbVotes >= 5 ? OMDbSeriesInfo.imdbRating : null}{(episodeInfo.vote_count as int) >= 5 ? epRating.round(1) : null}{' '}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}"
edit: it's doing it for everything now. this should probably be simplified. I trust omdb to provide accurate information so no need for the check for 5 votes, among other things, only these:
{ny}{s00e00}{t}{genres}{any{avg.episode.certification}{avg.series.certification}{NR}}{any{episode.rating}{series.rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}