please is there any way to use TheMovieDb for series?
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
please is there any way to use TheMovieDb for series?
another thing is that even though they do list the imdb tag, they don't actually come through filebot. I like to include the imdb tag in the filename because that way I can open the imdb page with two clicks using my lookup script in the context menu.
so I am in dire need of getting my series data from somewhere else. is it in any way possible to fetch series data via TheMovieDb? I mean they do have series and better data accuracy so why not? or at least tell me why imdb tag via TheTVDb is not delivered, they are not answering my emails.
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Re: please is there any way to use TheMovieDb for series?
If you're using TheTVDB, then you may be able to use the {omdb} (omdb info for given movie / series if available) binding in your format expression to get the ratings / ids you want.
e.g. series imdb id via omdb query:
Code: Select all
{omdb.imdbId}Code: Select all
{omdb.rating}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
how about command line? how do I signal TheMovieDb that I want series results?rednoah wrote: 14 Sep 2018, 14:51 Yes, you can click the TheMovieDB button instead of the TheTVDB button (Episode Mode section) if you prefer to match files with TheMovieDB episode data.
I can't get this to work. it said something about "." being unexpected while I was typing it in, and now returning to the screen it says "binding omdb: server returned http response code 401"rednoah wrote: 14 Sep 2018, 14:51If you're using TheTVDB, then you may be able to use the {omdb} (omdb info for given movie / series if available) binding in your format expression to get the ratings / ids you want.
e.g. series imdb id via omdb query:e.g. series rating via omdb query:Code: Select all
{omdb.imdbId}Code: Select all
{omdb.rating}
Note that {imdbid} only works for Movie Mode / Movie Objects and does not work for Episode Objects regardless of selected database.
I actually thought the OMDb had been out of use for years now. it has not worked for me at least.
anyway this is how I wrote it
Code: Select all
{n} {s00e00} {t} {genres} {certification} r{omdb.rating} {vf} {vc} {ac}-{omdb.imdbId}Re: please is there any way to use TheMovieDb for series?
you can if you use my custom AMC script:how about command line? how do I signal TheMovieDb that I want series results?
viewtopic.php?f=4&t=5451&p=31192#p31191
Code: Select all
To get TV from themoviedb:
--def tmdbTV=y (default is use thetvdb)-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
better continue here to stay on topic. i'm testing it now but I get this mishap. can I force tv mode in tmdb:kim wrote: 19 Sep 2018, 15:21 well it sounds like you don't want my script
so why not just use thisbtw: {t} will F up your movie files, better use 2 formatsCode: Select all
filebot -rename -non-strict --db TheMovieDB PATH_HERE --format "{n} {s00e00} {t} {genres} {certification} r{omdb.rating} {vf} {vc} {ac}-{omdb.imdbId}"![]()
Code: Select all
Auto-detect movie from context: [E:\TEMP\Who Is America S01E04.mkv]bringing me back to this earlier question.how about command line? how do I signal TheMovieDb that I want series results?
Re: please is there any way to use TheMovieDb for series?
Code: Select all
--db TheMovieDB::TV-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Code: Select all
Fetch failed: Try again in 5 seconds (2 more) => java.io.IOException: Server returned HTTP response code: 401 for URL: http://www.omdbapi.com/?i=tt8679236&tomatoes=falseRe: please is there any way to use TheMovieDb for series?
Code: Select all
--db TheMovieDB::TVWhy not working... ?... This is for rednoah
but omdb have TV info so ?Binding "omdb": net.filebot.web.SeriesInfo cannot be cast to net.filebot.web.TheTVDBSeriesInfo
viewtopic.php?t=5098#p28631
Price atm for using TheMovieDB::TVrednoah wrote: 08 Jun 2017, 05:57 1.
{imdbid} is only available for (most but not all) Movie objects, but not for Episode objects. I recommend using TheMovieDB ID for movies and TheTVDB ID for TV shows. Both of these can be accessed via the {id} binding.
{certification} and omdb stuff is not supported aka ask rednoah
workaround... use info from TheMovieDB
replace {omdb.rating}
Code: Select all
{rating}Code: Select all
{def eAddOns = ["append_to_response":"external_ids"]; net.filebot.WebServices.TheMovieDB.request("tv/${id}/season/${s}/episode/${e}", eAddOns, Locale.ENGLISH).external_ids.imdb_id}Code: Select all
{n} {s00e00} {t} {genres} r{rating} {vf} {vc} {ac}-{def eAddOns = ["append_to_response":"external_ids"]; net.filebot.WebServices.TheMovieDB.request("tv/${id}/season/${s}/episode/${e}", eAddOns, Locale.ENGLISH).external_ids.imdb_id}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
btw, don't tell me this is a VPN issue? I can't be turning that off. I'll check.
Re: please is there any way to use TheMovieDb for series?
Are you using the latest release? The OMDb API has changed and requires the latest release. FileBot 4.7.9 and older won't work.
2.
--db TheMovieDB::TV is indeed correct, since --mode forced BOTH database and series / movie mode, and internally there are two completely separate implementations for TheMovieDB that handle each mode separately.
e.g. retrieve episode list via TheMovieDB:
Code: Select all
filebot -list --q firefly --db TheMovieDB::TV3.
TheTVDB is the primary database. Some bindings, especially the more intricate ones, might not be supported if you use TheMovieDB. In this case, the {omdb} only works for TheTVDB (but not AniDB / TheMovieDB) since IMDb ID is required for lookup and (at the time) only TheTVDB included that ID in the series record. I'll have a look if TheMovieDB API provides IMDb ID as well now, then maybe this can be supported in a future release.
Top-level bindings such as {genres} {certification} {rating} etc work for TheMovieDB::TV but with data supplied by TheMovieDB and not IMDb / OMDb:
Code: Select all
$ filebot -list --q firefly --db TheMovieDB::TV --format "{n} {s00e00} {genres} {certification} {rating}"
Firefly S01E01 [Western, Drama, Action & Adventure, Sci-Fi & Fantasy] 8.2
...Re: please is there any way to use TheMovieDb for series?
https://www.themoviedb.org/tv/1437-firefly
I think because "Certificering" is only on the series level and not on the episode level (API)Certificering = TV-14
Re: please is there any way to use TheMovieDb for series?
EDIT:
Support for {certification} would require an additional HTTP request upfront that would be a waste unless {certification} is used in the format later on, and it isn't for most users most of the time, so {certification} will not be supported for TheMovieDB::TV for performances reasons and to not put unnecessary load on TheMovieDB services:
https://developers.themoviedb.org/3/tv/ ... nt-ratings
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Re: please is there any way to use TheMovieDb for series?
The series {rating} works out of the box.
2.
IMDB ID is not part of the series record, but there might be a way to somehow look up the IMDB ID via the TMDB Series ID via the API somehow:
https://developers.themoviedb.org/3/tv/get-tv-details
3.
For the certification, you could make your own TheMovieDB API request in your custom format. You can build the request URL by using your own API key and {id} and parse the result with Groovy JsonSlurper. It's a simple one liner. The same could be done for episode specific (you have episode.id too) ratings. The same could be done for IMDB lookup.
e.g
Code: Select all
{
def url = new URL('https://www.filebot.net/reviews.json')
def json = new groovy.json.JsonSlurper().parse(url)
return json[0].text
}Re: please is there any way to use TheMovieDb for series?
Code: Select all
{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/${s}/episode/${e}", 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 mpaaCountryLIST = ['US']
def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{"$it.rating"}.join();
(allOf{n}{s00e00}{t}{genres}{mpaaRating}{'r'+epRating}{vf}{vc}{ac}{'-'+epImdbId}).join(' ')
}change this if you want imdb id for the series not episode
def epImdbId = episodeInfo.external_ids.imdb_id; and {epImdbId}
to
def sImdbId = seriesInfo.external_ids.imdb_id; and {sImdbId}
like {omdb.imdbId} does
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Re: please is there any way to use TheMovieDb for series?
Code: Select all
filebot -list --q firefly --db TheMovieDB::TV --format "{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/${s}/episode/${e}\", 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 mpaaCountryLIST = ['US']; def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{\"$it.rating\"}.join(); (allOf{n}{s00e00}{t}{genres}{mpaaRating}{'r'+epRating}{vf}{vc}{ac}{'-'+epImdbId}).join(' ')}"-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
I tried a recent episode of tosh.0 and I get no certification, rating 0.0 and `null`instead of imdb tag. I tried an episode of GoT and got good results! I wanna build a script that puts in series level info when episode level info is not available. the only thing I would change is get the genres from somewhere else (I don't like the combined `action & adventure` and `scifi & fantasy` genres).kim wrote: 23 Sep 2018, 19:38 like so (ALL in 1 line):
Code: Select all
filebot -list --q firefly --db TheMovieDB::TV --format "{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/${s}/episode/${e}\", 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 mpaaCountryLIST = ['US']; def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{\"$it.rating\"}.join(); (allOf{n}{s00e00}{t}{genres}{mpaaRating}{'r'+epRating}{vf}{vc}{ac}{'-'+epImdbId}).join(' ')}"
Re: please is there any way to use TheMovieDb for series?
All else DONE (I think)
Code: Select all
filebot -list --q firefly --db TheMovieDB::TV --def ut_label=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 mpaaCountryLIST = ['CA', 'DE', 'GB', 'US']; def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{\"$it.rating\"}.last(); def newGenre = genres*.split(' & ').flatten().each{it}; (allOf{n}{s00e00}{t}{newGenre}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{'-'+any{epImdbId}{sImdbId}}).join(' ')}" --action testFirefly S01E01 The Train Job [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.4 -tt0579539
Firefly S01E02 Bushwhacked [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.5 -tt0579528
Firefly S01E03 Our Mrs. Reynolds [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.4 -tt0579532
Firefly S01E04 Jaynestown [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.4 -tt0579530
Firefly S01E05 Out of Gas [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r9.1 -tt0579533
Firefly S01E06 Shindig [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r7.9 -tt0579537
Firefly S01E07 Safe [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.0 -tt0579534
Firefly S01E08 Ariel [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.5 -tt0579527
Firefly S01E09 War Stories [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.1 -tt0579541
Firefly S01E10 Objects in Space [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r9.0 -tt0579531
Firefly S01E11 Serenity [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r7.8 -tt0579535
Firefly S01E12 Heart of Gold [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.1 -tt0579529
Firefly S01E13 Trash [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.2 -tt0579540
Firefly S01E14 The Message [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r7.9 -tt0579538
Firefly S00E01 Serenity [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r10.0 -tt0379786
Firefly S00E02 Here?s How It Was: The Making of ?Firefly? [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.2 -tt0303461
Firefly S00E03 Done the Impossible [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.2 -tt0303461
Firefly S00E04 Browncoats Unite [Western, Drama, Action, Adventure, Sci-Fi, Fantasy] TV-14 r8.2 -tt0303461
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
but just to split action & adventure and Sci-Fi & Fantasy is silly. Firefly is not fantasy, Game of Thrones is not sci-fi etc. I don't know why they decided to merge those genres since they've now stopped serving their purpose. they don't use the combos for movies. I take it this means it's not possible (in a single fetch) to also get genres from like tvdb?
I'm starting to learn this language a little bit. is this java?
where are these episode specific ratings coming from? I don't see a per episode voter in themoviedb, and there doesn't seem to be a lot of votes either.
Re: please is there any way to use TheMovieDb for series?
Code: Select all
filebot -list --q firefly --db TheMovieDB::TV --def ut_label=TV --format "{def tvdbId = net.filebot.WebServices.TheTVDB.search(series.name, Locale.US).id.join().toInteger(); def tvdbInfo = net.filebot.WebServices.TheTVDB.getSeriesInfo(tvdbId, Locale.US); 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 mpaaCountryLIST = ['CA', 'DE', 'GB', 'US']; def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{\"$it.rating\"}.last(); def newGenre = genres*.split(' & ').flatten().each{it}; (allOf{n}{s00e00}{t}{any{tvdbInfo.genres}{newGenre}}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{'-'+any{epImdbId}{sImdbId}}).join(' ')}" --action testratings.... you see it now (8.4) ?
https://www.themoviedb.org/tv/1437-fire ... /episode/1
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Code: Select all
d:\SOURCE\Mom.S06E01.1080p.HDTV.x264-PLUTONiUM[TGx]>if "show" == "show" set "form={def tvdbId = net.filebot.WebServices.TheTVDB.search(series.name, Locale.US).id.join().toInteger(); def tvdbInfo = net.filebot.WebServices.TheTVDB.getSeriesInfo(tvdbId, Locale.US); 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 mpaaCountryLIST = ['CA', 'DE', 'GB', 'US']; def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{\"$it.rating\"}.last(); def newGenre = genres*.split(' & ').flatten().each{it}; (allOf{n}{s00e00}{t}{any{tvdbInfo.genres}{newGenre}}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}"
d:\SOURCE\Mom.S06E01.1080p.HDTV.x264-PLUTONiUM[TGx]>if "show" == "show" filebot -rename -non-strict --db TheMovieDB::TV "E:\TEMP\vren2809181415553\Mom S06E01 1080p HDTV x264-PLUTONiUM.mkv" --q "MOM " --format "{def tvdbId = net.filebot.WebServices.TheTVDB.search(series.name, Locale.US).id.join().toInteger(); def tvdbInfo = net.filebot.WebServices.TheTVDB.getSeriesInfo(tvdbId, Locale.US); 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 mpaaCountryLIST = ['CA', 'DE', 'GB', 'US']; def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{\"$it.rating\"}.last(); def newGenre = genres*.split(' & ').flatten().each{it}; (allOf{n}{s00e00}{t}{any{tvdbInfo.genres}{newGenre}}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}" 1>nul
Expression yields empty value: For input string: "266967767912643572998843474592763733213542745601485612973853349931248212738302962792931933458242950152211412718163216347536028535229541629421531923032503826993526357932461635219729114129906134862227219613393126787730453591931342728272850342726311211317414737213362373147472742217275815783128195032955880337341049328708336480"
net.filebot.format.SuppressedThrowables: Expression yields empty value: For input string: "266967767912643572998843474592763733213542745601485612973853349931248212738302962792931933458242950152211412718163216347536028535229541629421531923032503826993526357932461635219729114129906134862227219613393126787730453591931342728272850342726311211317414737213362373147472742217275815783128195032955880337341049328708336480"
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:163)
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:129)
at net.filebot.cli.CmdlineOperations.formatMatches(CmdlineOperations.java:570)
at net.filebot.cli.CmdlineOperations.renameSeries(CmdlineOperations.java:250)
at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:96)
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)
Caused by: java.lang.NumberFormatException: For input string: "266967767912643572998843474592763733213542745601485612973853349931248212738302962792931933458242950152211412718163216347536028535229541629421531923032503826993526357932461635219729114129906134862227219613393126787730453591931342728272850342726311211317414737213362373147472742217275815783128195032955880337341049328708336480"
at Script1.run(Script1.groovy:1)
at net.filebot.format.SecureCompiledScript$1.run(SecureCompiledScript.java:87)
at net.filebot.format.SecureCompiledScript.eval(SecureCompiledScript.java:83)
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:147)
... 7 moreRe: please is there any way to use TheMovieDb for series?
Code: Select all
d:\SOURCE\Mom.S06E01.1080p.HDTV.x264-PLUTONiUM[TGx]>if "show" == "show" set "form={CUSTOM FORMAT}"
d:\SOURCE\Mom.S06E01.1080p.HDTV.x264-PLUTONiUM[TGx]>if "show" == "show" filebot -rename -non-strict --db TheMovieDB::TV "E:\TEMP\vren2809181415553\Mom S06E01 1080p HDTV x264-PLUTONiUM.mkv" --q "MOM " --format "{CUSTOM FORMAT}" 1>nul
Expression yields empty value: For input string: "266967767912643572998843474592763733213542745601485612973853349931248212738302962792931933458242950152211412718163216347536028535229541629421531923032503826993526357932461635219729114129906134862227219613393126787730453591931342728272850342726311211317414737213362373147472742217275815783128195032955880337341049328708336480"
net.filebot.format.SuppressedThrowables: Expression yields empty value: For input string: "266967767912643572998843474592763733213542745601485612973853349931248212738302962792931933458242950152211412718163216347536028535229541629421531923032503826993526357932461635219729114129906134862227219613393126787730453591931342728272850342726311211317414737213362373147472742217275815783128195032955880337341049328708336480"
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:163)
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:129)
at net.filebot.cli.CmdlineOperations.formatMatches(CmdlineOperations.java:570)
at net.filebot.cli.CmdlineOperations.renameSeries(CmdlineOperations.java:250)
at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:96)
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)
Caused by: java.lang.NumberFormatException: For input string: "266967767912643572998843474592763733213542745601485612973853349931248212738302962792931933458242950152211412718163216347536028535229541629421531923032503826993526357932461635219729114129906134862227219613393126787730453591931342728272850342726311211317414737213362373147472742217275815783128195032955880337341049328708336480"
at Script1.run(Script1.groovy:1)
at net.filebot.format.SecureCompiledScript$1.run(SecureCompiledScript.java:87)
at net.filebot.format.SecureCompiledScript.eval(SecureCompiledScript.java:83)
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:147)
... 7 moreRe: please is there any way to use TheMovieDb for series?
Code: Select all
net.filebot.WebServices.TheTVDB.search(series.name, Locale.US).id.join().toInteger()Why not just use {id} then? The series id is already a given when you select TheTVDB to match files.
Re: please is there any way to use TheMovieDb for series?
anyhoo
Format Version 3.0
This will (I think) with any show with a tvdb id, if no id ADD IT
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 sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null}; def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; def mpaaCountryLIST = ['CA', 'DE', 'GB', 'US']; def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{\"$it.rating\"}.last(); def newGenre = genres*.split(' & ').flatten().each{it}; (allOf{n}{s00e00}{t}{any{tvdbInfo.genres}{newGenre}}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{'-'+any{epImdbId}{sImdbId}}).join(' ')}the new codeMom S06E01 Pre-Washed Lettuce and a Mime [Comedy, Drama] TV-14 r6.3 -tt8355548
Code: Select all
def sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null};
def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; With TVDB genres (Warning: this is not so fast anymore AND it's possible to find wrong show/info)
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
also, how do I use this format in the GUI mode?
Re: please is there any way to use TheMovieDb for series?
Re: please is there any way to use TheMovieDb for series?
Why:SyntaxError: unexpected char: '\'
because the need to escape characters in the CLI
viewtopic.php?t=1899
Fix:
replace
Code: Select all
\"Code: Select all
"Code: Select all
\-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Code: Select all
Expression yields empty value: Cannot access last() element from an empty List
net.filebot.format.SuppressedThrowables: Expression yields empty value: Cannot access last() element from an empty List
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:163)
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:129)
at net.filebot.cli.CmdlineOperations.formatMatches(CmdlineOperations.java:570)
at net.filebot.cli.CmdlineOperations.renameSeries(CmdlineOperations.java:250)
at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:96)
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)
Caused by: java.util.NoSuchElementException: Cannot access last() element from an empty List
at Script1.run(Script1.groovy:1)
at net.filebot.format.SecureCompiledScript$1.run(SecureCompiledScript.java:87)
at net.filebot.format.SecureCompiledScript.eval(SecureCompiledScript.java:83)
at net.filebot.format.ExpressionFormat.format(ExpressionFormat.java:147)
... 7 moreCode: Select all
filebot -rename -non-strict --db TheMovieDB::TV "%full%" --q "united states of bacon " --format "%format%"Re: please is there any way to use TheMovieDb for series?
Code: Select all
def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{"$it.rating"}.last();Code: Select all
def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{"$it.rating"}.last()}{'No Certification'};"Content Rating" to https://www.themoviedb.org/tv/64954-uni ... nt_ratings
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
if I'm understanding this correctly, now that it isn't using themoviedb genres I can change
Code: Select all
def newGenre = genres*.split(' & ').flatten().each{it}; (allOf{n}{s00e00}{t}{any{tvdbInfo.genres}{newGenre}}Code: Select all
(allOf{n}{s00e00}{t}{tvdbInfo.genres}Re: please is there any way to use TheMovieDb for series?
or
remove
Code: Select all
def newGenre = genres*.split(' & ').flatten().each{it}; Code: Select all
{any{tvdbInfo.genres}{genres}}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
note that there are other changes. I reconstructed it but still it gives me "no certification" always.
Code: Select all
filebot -rename -non-strict --db TheMovieDB::TV "friends s01e03.mkv" --q "friends" --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 sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null}; def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; def mpaaCountryLIST = ['CA', 'DE', 'GB', 'US']; def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{"$it.rating"}.last()}{'No Certification'}; (allOf{n}{s00e00}{t}{tvdbInfo.genres}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}"Re: please is there any way to use TheMovieDb for series?
viewtopic.php?f=10&p=36169#p36099
Code: Select all
\"$it.rating\"Code: Select all
{it.rating}Use the GUI and play round with the format
ONLY US cert
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 sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null};
def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null;
def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> r.any{r.iso_3166_1 == 'US'}}.collect{it.rating}[0]}{'No Certification'};
(allOf{n}{s00e00}{t}{tvdbInfo.genres}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')
}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Re: please is there any way to use TheMovieDb for series?
viewtopic.php?f=4&t=3244
That way you can just copy & paste your format from the GUI into a text file, and use it as is without having to worry about command-line escaping anything.
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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 sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null};
def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null;
def mpaaCountryLIST = ['FI', 'US', 'CA', 'GB'];
def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{it.rating}.last()}{''};
(allOf{n}{s00e00}{t}{tvdbInfo.genres}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')
}Code: Select all
filebot -script --db TheMovieDB::TV "friends s01e03.mkv" --q "friends" --format "@args.txt"
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <:> at index 10: TheMovieDB::TV (TheMovieDB::TV)
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <?> at index 26: def season = (any{special ? 0 : s} {s}); (def season = (any{special ? 0 : s} {s}); )
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <?> at index 27: def episode = (any{special ? special : e} {e}); (def episode = (any{special ? special : e} {e}); )
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <:> at index 35: def eAddOns = ['append_to_response':'external_ids']; (def eAddOns = ['append_to_response':'external_ids']; )
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <:> at index 35: def sAddOns = ['append_to_response':'external_ids,content_ratings']; (def sAddOns = ['append_to_response':'external_ids,content_ratings']; )
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <"> at index 62: def episodeInfo = net.filebot.WebServices.TheMovieDB.request(\"tv\${id}\season\${season}\episode\${episode}\", eAddOns, Locale.US); (def episodeInfo = net.filebot.WebServices.TheMovieDB.request(\"tv\${id}\season\${season}\episode\${episode}\", eAddOns, Locale.US); )
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <"> at index 61: def seriesInfo = net.filebot.WebServices.TheMovieDB.request(\"tv\${id}\", sAddOns, Locale.US); (def seriesInfo = net.filebot.WebServices.TheMovieDB.request(\"tv\${id}\", sAddOns, Locale.US); )
Illegal Argument: java.nio.file.InvalidPathException: Trailing char < > at index 40: def epRating = episodeInfo.vote_average; (def epRating = episodeInfo.vote_average; )
Illegal Argument: java.nio.file.InvalidPathException: Trailing char < > at index 48: def epImdbId = episodeInfo.external_ids.imdb_id; (def epImdbId = episodeInfo.external_ids.imdb_id; )
Illegal Argument: java.nio.file.InvalidPathException: Trailing char < > at index 46: def sImdbId = seriesInfo.external_ids.imdb_id; (def sImdbId = seriesInfo.external_ids.imdb_id; )
Illegal Argument: java.nio.file.InvalidPathException: Trailing char < > at index 69: def sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null}; (def sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null}; )
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <?> at index 33: def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; (def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; )
Illegal Argument: java.nio.file.InvalidPathException: Trailing char < > at index 47: def mpaaCountryLIST = ['FI', 'US', 'CA', 'GB']; (def mpaaCountryLIST = ['FI', 'US', 'CA', 'GB']; )
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <>> at index 67: def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{it.rating}.last()}{''}; (def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{it.rating}.last()}{''}; )
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <?> at index 87: (allOf{n}{s00e00}{t}{tvdbInfo.genres}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ') ((allOf{n}{s00e00}{t}{tvdbInfo.genres}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' '))
Illegal Argument: java.nio.file.NoSuchFileException: C:\Users\Administrator\} (})
Bad script source: --db
Failure (°_°)Code: Select all
filebot -script fn:rename --db TheMovieDB::TV "friends s01e03.mkv" --q "friends" --def "@args.txt"Re: please is there any way to use TheMovieDb for series?
However, if you're using simple filebot -rename calls, then you can only do filebot @args.txt which allows you to pass all arguments line by line which means your format has to be a single line as well. Not ideal for complex formats, but that's how it works.
e.g.
Code: Select all
-rename
--format
{n} {sxe} {t}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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 sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null}; def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; def mpaaCountryLIST = ['FI', 'US', 'CA', 'GB']; def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{it.rating}.last()}{''}; (allOf{n}{s00e00}{t}{tvdbInfo.genres}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}"Code: Select all
filebot "friends s01e03.mkv" --q "friends" --def @args.txtCode: Select all
SyntaxError: unexpected token: }
javax.script.ScriptException: SyntaxError: unexpected token: }
at net.filebot.format.ExpressionFormat.compile(ExpressionFormat.java:106)
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)
Failure (°_°)Re: please is there any way to use TheMovieDb for series?
No, because 1 argument per 1 line. The entire point of doing this is so that you don't need to quote or escape arguments, because you're using lines to separate arguments, and not spaces.
NO:
Code: Select all
-rename
--db TheMovieDB::TVYES:
Code: Select all
-rename
--db
TheMovieDB::TV2.
Forget about --def. It's confusing you. If you're using filebot -rename then --def does not exist as far as you need to know. --def name=value are used to pass arbitrary key=value pairs into custom scripts which is not relevant for this particular use case.
NO:
Code: Select all
filebot "friends s01e03.mkv" --q "friends" --def @args.txtCode: Select all
filebot @args.txt "friends s01e03.mkv" --q "friends"Code: Select all
filebot "friends s01e03.mkv" --q "friends" @args.txt-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
still, I'm interested in the order of the mpaaCountryLIST, not to focus on US certifications but to customize the list. if I want 'FI' and 'US' but I prefer 'FI' then do I place it first or last?
Re: please is there any way to use TheMovieDb for series?
Very few (if any) has 'FI' rating... but anyhoo this is what you want
if 'FI' use... else if 'US' use... else null aka blank
Code: Select all
def mpaaRating = any{seriesInfo.content_ratings.results.findAll{it.iso_3166_1 == 'FI' ? it : it.iso_3166_1 == 'US' ? it : null}.find{it}.rating}{''};Code: Select all
def mpaaCountryLIST = ['FI', 'US', 'CA', 'GB'];
def mpaaRating = any{seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{it.rating}.last()}{''};-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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 sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{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{n}({y}){s00e00}{t}{tvdbInfo.genres}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}"Re: please is there any way to use TheMovieDb for series?
Code: Select all
{'('+y+')'}Code: Select all
{ny}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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 sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{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}{tvdbInfo.genres}{any{mpaaRating}{'NR'}}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{epRating.toString() != '10.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}Re: please is there any way to use TheMovieDb for series?
Code: Select all
{'r'+any{epRating.toString() != '0.0' && epRating.toString() != '10.0' ? epRating.round(1) : null}{rating}}Code: Select all
{'r'+any{epRating != 0.0 && epRating != 10.0 ? epRating.round(1) : null}{rating}}Code: Select all
{'r'+any{epRating > 0.0 && epRating < 10.0 ? epRating.round(1) : null}{'rating'}}Re: please is there any way to use TheMovieDb for series?
Code: Select all
{'r'+any{episodeInfo.vote_count > 1 || epRating > 0.0 && epRating < 10.0 ? epRating.round(1) : null}{rating}}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
would you please send me your bitcoin address, I would like to send you a few "beers" as thanks!
Re: please is there any way to use TheMovieDb for series?
Noice! w00t w00t for kim!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!
Re: please is there any way to use TheMovieDb for series?
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(' ')}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(' ')}Re: please is there any way to use TheMovieDb for series?
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(' ')}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(' ')}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
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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?
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/
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
plus could you please build one that renames movies via omdb?
Re: please is there any way to use TheMovieDb for series?
I need a sample ?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.
why is there a need for this ?renames movies via omdb
sample ?
you can just use:
Code: Select all
{omdb.genres}Code: Select all
{omdb.rating}Code: Select all
{omdb.votes}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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?
Code: Select all
{OMDbSeriesInfo.Rated.replaceAll(/N\/A/)}Code: Select all
{OMDbSeriesInfo.Rated.replaceAll(/N\\/A/)} Code: Select all
def certifications = net.filebot.WebServices.TheMovieDB.getMovieInfo(movie, Locale.US, true).certificationsCode: Select all
{certifications.FI}all available from:K-13
Code: Select all
{certifications}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
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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?
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"}Re: please is there any way to use TheMovieDb for series?
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.
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Re: please is there any way to use TheMovieDb for series?
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
that would be Amazon.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.
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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(' ')}"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...
...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?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?
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"}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(' ')}PS: I don't think it will work well with e.g. "For all ages" cert.Avatar (2009) James Cameron [Action, Adventure, Fantasy] K-12 r7.8 tt0499549
e.g. Cinderella 1950 = K-3
https://en.wikipedia.org/wiki/Finnish_B ... sification
so maybe use
Code: Select all
{avg > 5 ? 'K-'+avg : null}Code: Select all
{avg == 0 ? 'S' : 'K-'+avg}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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?
viewtopic.php?f=4&t=1899
Re: please is there any way to use TheMovieDb for series?
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(' ')}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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 releaseRe: please is there any way to use TheMovieDb for series?
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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?
Code: Select all
def cleanNum = certifications.findResults{key, value -> value.replaceAll('\\D')}.findAll{it}*.toInteger().findAll{it < 22}; -
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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(' ')}"{ny}{s00e00}{t}{genres}{any{avg.episode.certification}{avg.series.certification}{NR}}{any{episode.rating}{series.rating}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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()}{''}; def ecertifications = net.filebot.WebServices.TheMovieDB.getEpisodeInfo(eAddOns, Locale.US, true).ecertifications; def ecleanNum = ecertifications.findResults{key, value -> value.replaceAll('\\D')}.findAll{it}*.toInteger().findAll{it < 22}; def int eavg = (ecleanNum.sum() / ecleanNum.size()).toDouble().round(); def scertifications = net.filebot.WebServices.TheMovieDB.getSeriesInfo(sAddOns, Locale.US, true).scertifications; def scleanNum = scertifications.findResults{key, value -> value.replaceAll('\\D')}.findAll{it}*.toInteger().findAll{it < 22}; def int eavg = (scleanNum.sum() / scleanNum.size()).toDouble().round(); (allOf{ny}{s00e00}{t}{OMDbEpisodeInfo.Genre}{'c'+any{eavg}{savg}{'NR'}}{'r'+any{OMDbSeriesInfo.imdbRating}{epRating.round(1)}{' '}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}"Re: please is there any way to use TheMovieDb for series?
1. in short = nocafevincent wrote: 11 Nov 2018, 12:56 is this close? it says "The current scope already contains a variable of the name eavg"
2. can you have more then 1 variable named "eavg" on same "level" ?
3. do you see "content ratings (certifications)" on episode level ?
https://developers.themoviedb.org/3/tv- ... de-details
4. why do you change my code and not confirming your changes works in the GUI piece by piece ?
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
just got to realizing both those things just before noticing this post, believe it or not.. you gave me just enough time for self-reflection. sorrykim wrote: 12 Nov 2018, 19:13 1. in short = no
2. can you have more then 1 variable named "eavg" on same "level" ?
3. do you see "content ratings (certifications)" on episode level ?
https://developers.themoviedb.org/3/tv- ... de-details
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 epRating = episodeInfo.vote_average; def seriesInfo = net.filebot.WebServices.TheMovieDB.request("tv/${id}", sAddOns, Locale.US); def certifications = net.filebot.WebServices.TheMovieDB.getSeriesInfo(series, Locale.US, true).certifications; def cleanNum = certifications.findResults{key, value -> value.replaceAll('\\D')}.findAll{it}*.toInteger().findAll{it < 22}; def int avg = (cleanNum.sum() / cleanNum.size()).toDouble().round(); def OMDbEpisodeInfo = (epImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':epImdbId]) : null; def epImdbId = episodeInfo.external_ids.imdb_id; (allOf{ny}{s00e00}{t}{OMDbEpisodeInfo.Genre}{'c'{avg}}{'r'{OMDbEpisodeInfo.imdbRating}}{vf}{vc}{ac}{epImdbId}).join(' ')}"thanks for the tip.kim wrote: 12 Nov 2018, 19:13 4. why do you change my code and not confirming your changes works in the GUI piece by piece ?
Re: please is there any way to use TheMovieDb for series?
Code: Select all
{
def sAddOns = ['append_to_response':'external_ids,content_ratings'];
def seriesInfo = net.filebot.WebServices.TheMovieDB.request(\u0022tv/${id}\u0022, sAddOns, Locale.US);
def scleanNum = seriesInfo.content_ratings.results*.findResults{key, value -> value.replaceAll('\\D')}.flatten().findAll{it}*.toInteger().findAll{it < 22};
int savg = (scleanNum.sum().div(scleanNum.size())).toDouble().round();
}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Re: please is there any way to use TheMovieDb for series?
Code: Select all
--format
"def seasonCode: Select all
--format
"{def season-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Code: Select all
Rename episodes using [TheMovieDB]
Fetching episode data for [StartUp]
Stripping invalid characters from new path: ""
[MOVE] from [E:\TEMP\vr1507079\StartUp 2016 S03E01 Rebranding 1080p.mkv] to [E:\TEMP\vr1507079\.mkv]
Processed 1 filesCode: 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 epRating = episodeInfo.vote_average; def seriesInfo = net.filebot.WebServices.TheMovieDB.request(\u0022tv/${id}\u0022, sAddOns, Locale.US); def certifications = net.filebot.WebServices.TheMovieDB.getSeriesInfo(series, Locale.US, true).certifications; def cleanNum = seriesInfo.content_ratings.results*.findResults{key, value -> value.replaceAll('\\D')}.flatten().findAll{it}*.toInteger().findAll{it < 22}; def int avg = (cleanNum.sum().div(cleanNum.size())).toDouble().round(); def OMDbEpisodeInfo = (epImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':epImdbId]) : null; def epImdbId = episodeInfo.external_ids.imdb_id; (allOf{ny}{s00e00}{t}{OMDbEpisodeInfo.Genre}{'c'{avg}}{'r'{OMDbEpisodeInfo.imdbRating}}{vf}{vc}{ac}{epImdbId}).join(' ')}"Re: please is there any way to use TheMovieDb for series?
This is weird:
Code: Select all
\u0022tv/${id}\u00222.
It also seems net.filebot.WebServices.TheTVDB has been find-and-replaced with net.filebot.WebServices.TheMovieDB which is completely incompatible. net.filebot.WebServices.TheMovieDB_TV on the other hand might implement the EpisodeListProvider interface just as net.filebot.WebServices.TheTVDB does. It's complicated, and really more about writing FileBot code, than writing format code.
Re: please is there any way to use TheMovieDb for series?
Step 1:
Code: Select all
{
def season = (any{special ? 0 : s} {s})
}Code: Select all
1Code: Select all
{
def season = (any{special ? 0 : s} {s})
def episode = (any{special ? special : e} {e})
}Code: Select all
1Code: 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)
}Code: Select all
{air_date=2016-09-06, crew=[Ljava.lang.Object;@7c167ad1, episode_number=1, guest_stars=[Ljava.lang.Object;@41577f51, name=Seed Money, overview=When Miami tech visionary Izzy Morales fails to attract funding for her new cryptocurrency GenCoin, financier Nick Talman funnels dirty money from his embezzling father. Meanwhile, gangster Ronald Dacey finds his money is missing, while cynical FBI agent Phil Rask hunts for Nick’s father., id=1216012, production_code=null, season_number=1, still_path=/tT50TbFpYqwsNqJX1ZmjG5eprCm.jpg, vote_average=5.5, vote_count=2, external_ids={imdb_id=tt5653618, freebase_mid=null, freebase_id=null, tvdb_id=5645387, tvrage_id=null}}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 epRating = episodeInfo.vote_average
def seriesInfo = net.filebot.WebServices.TheMovieDB.request("${id}", sAddOns, Locale.US)
}Code: Select all
Expression yields empty value: Resource is empty: {} => https://api.themoviedb.org/3/66310?append_to_response=external_ids%2Ccontent_ratings&language=en-USRe: please is there any way to use TheMovieDb for series?
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 scleanNum = seriesInfo.content_ratings.results*.findResults{key, value -> value.replaceAll('\\D')}.flatten().findAll{it}*.toInteger().findAll{it < 22};
int savg = (scleanNum.sum().div(scleanNum.size())).toDouble().round();
def eOMDbYear = OMDbEpisodeInfo.Released.match(/(?:19|20)\d{2}/);
def sOMDbYear = OMDbSeriesInfo.Released.match(/(?:19|20)\d{2}/);
(allOf{ny}{s00e00}{t}{OMDbEpisodeInfo.Genre.split(',')}{'c'+any{savg}{'NR'}}{'r'+any{OMDbEpisodeInfo.imdbRating.replaceAll(/N\/A/)}{epRating.round(1)}{' '}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')
}I think it's bad. but use eOMDbYear and/or sOMDbYear how you want.Firefly (2002) S01E01 The Train Job [Adventure, Drama, Sci-Fi] c14 r8.5 tt0579539
btw:the year be taken from the omdb air date.
= "\u0022
I was thinking it was better to use in the 1 line CLI, with the escaping stuff ?
Re: please is there any way to use TheMovieDb for series?
e.g.
Code: Select all
--format @'
{n}
-
{s00e00}
-
{t}
'@-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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 scleanNum = seriesInfo.content_ratings.results*.findResults{key, value -> value.replaceAll('\\D')}.flatten().findAll{it}*.toInteger().findAll{it < 22}; int savg = (scleanNum.sum().div(scleanNum.size())).toDouble().round(); def eOMDbYear = OMDbEpisodeInfo.Released.match(/(?:19|20)\d{2}/); def sOMDbYear = OMDbSeriesInfo.Released.match(/(?:19|20)\d{2}/); (allOf{n}{any{'('+eOMDbYear+')'}{'('+sOMDbYear+')'}}{s00e00}{t}{OMDbEpisodeInfo.Genre.split(',')}{'c'+any{savg}{'NR'}}{'r'+any{OMDbEpisodeInfo.imdbRating.replaceAll(/N\/A/)}{epRating.round(1)}{' '}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')}"-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
instead of nullifying in a situation like this, maybe it would be ideal to display the only (non-numeral) rating as-is? I have the retype script that can change those to whatever is needed. I tried doing this like
Code: Select all
{'c'+any{savg}{certification}{'NR'}}Re: please is there any way to use TheMovieDb for series?
Code: Select all
certificationCode: 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 scleanNum = any{seriesInfo.content_ratings.results*.findResults{key, value -> value.replaceAll('\\D')}.flatten().findAll{it}*.toInteger().findAll{it < 22}}{null};
int savg = any{(scleanNum.sum().div(scleanNum.size())).toDouble().round()}{null};
def eOMDbYear = any{OMDbEpisodeInfo.Released.match(/(?:19|20)\d{2}/)}{null};
def sOMDbYear = any{OMDbSeriesInfo.Released.match(/(?:19|20)\d{2}/)}{null};
(allOf{n}{'('+any{eOMDbYear}{sOMDbYear}+')'}{s00e00}{t}{OMDbEpisodeInfo.Genre.split(',')}{'c'+any{savg}{seriesInfo.content_ratings.results.rating[0]}{'NR'}}{'r'+any{OMDbEpisodeInfo.imdbRating.replaceAll(/N\/A/)}{epRating.round(1).toString().replaceAll(/0.0/)}{rating}{' '}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')
}Gary and His Demons (2018) S01E01 Still The One cTV-MA r9.0 tt8421152
better... replaced eOMDbYear/sOMDbYear with epYear/y
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 scleanNum = any{seriesInfo.content_ratings.results*.findResults{key, value -> value.replaceAll('\\D')}.flatten().findAll{it}*.toInteger().findAll{it < 22}}{null};
def savg = any{(scleanNum.sum().div(scleanNum.size())).toDouble().round() as int }{seriesInfo.content_ratings.results.rating[0]}{null};
def epYear = any{episodeInfo.air_date.match(/(?:19|20)\d{2}/)}{null};
(allOf{n}{'('+any{epYear}{y}+')'}{s00e00}{t}{OMDbEpisodeInfo.Genre.split(',')}{'c'+any{savg}{}{'NR'}}{'r'+any{OMDbEpisodeInfo.imdbRating.replaceAll(/N\/A/)}{epRating.round(1).toString().replaceAll(/0.0/)}{rating}{' '}}{vf}{vc}{ac}{any{epImdbId}{sImdbId}}).join(' ')
}-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
-there was no genres, only the brackets
-they all had different rating than imdb
-they all had the series imdb id
I was guessing there was a momentary lapse of connection to omdb, but I'm getting massive amounts of files named like this for lesser known shows. this also started happening to "gary and his demons" after your last adjustment. I will investigate more and report back another day.
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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 scleanNum = any{seriesInfo.content_ratings.results*.findResults{key, value -> value.replaceAll('D')}.flatten().findAll{it}*.toInteger().findAll{it < 22}}{null}; def savg = any{(scleanNum.sum().div(scleanNum.size())).toDouble().round() as int }{seriesInfo.content_ratings.results.rating[0]}{null}; def epYear = any{episodeInfo.air_date.match(/(?:19|20)d{2}/)}{null}; (allOf{n}{'('+{epYear}+')'}{s00e00}{t}{'['+{OMDbEpisodeInfo.Genre}+']'}{'c'+any{savg}{}{'NR'}}{'r'+any{OMDbEpisodeInfo.imdbRating.replaceAll(/N/A/)}{epRating.round(1).toString().replaceAll(/0.0/)}{rating}{' '}}{vf}{vc}{ac}{epImdbId}).join(' ')}"Re: please is there any way to use TheMovieDb for series?
If the format works fine in the GUI, then it's a command line issues, things getting interpreted by your shell in unexpected ways. In this case, using PowerShell and multi-line literals @""@ should do the trick.
Re: please is there any way to use TheMovieDb for series?
does the year work ?N/A
also is this the same ?
Code: Select all
replaceAll('\\D')Code: Select all
replaceAll('D')btw it's better to use
Code: Select all
OMDbSeriesInfo.GenreCode: Select all
OMDbEpisodeInfo.Genre-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
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 scleanNum = any{seriesInfo.content_ratings.results*.findResults{key, value -> value.replaceAll('D')}.flatten().findAll{it}*.toInteger().findAll{it < 22}}{null}; def savg = any{(scleanNum.sum().div(scleanNum.size())).toDouble().round() as int }{seriesInfo.content_ratings.results.rating[0]}{null}; def epYear = any{episodeInfo.air_date.match(/(?:19|20)d{2}/)}{null}; (allOf{n}{'('+{epYear}+')'}{s00e00}{t}{'['+{OMDbEpisodeInfo.Genre}+']'}{'c'+any{savg}{}{'NR'}}{'r'+any{OMDbEpisodeInfo.imdbRating.replaceAll(/N\/A/)}{epRating.round(1).toString().replaceAll(/0.0/)}{rating}{' '}}{vf}{vc}{ac}{epImdbId}).join(' ')}Re: please is there any way to use TheMovieDb for series?
Code: Select all
def epYear = any{episodeInfo.air_date.match(/(?:19|20)d{2}/)}{null};Code: Select all
{episodeInfo.air_date.match(/(?:19|20)d{2}/)}Code: Select all
{episodeInfo.air_date.match(/(?:19|20)/)}Code: Select all
{episodeInfo.air_date}try and you find problem
btw: Gui will only show output of last line, so best to test with is remove the "(allOf..." line
-
cafevincent
- Posts: 66
- Joined: 22 Jun 2017, 10:08
Re: please is there any way to use TheMovieDb for series?
Code: Select all
{episodeInfo.air_date.match(/(?:19|20)d{2}/)}Code: Select all
Expression yields empty value: Patter not found: 2018-04-13Code: Select all
{episodeInfo.air_date.match(/(?:19|20)/)}Code: Select all
20Code: Select all
{episodeInfo.air_date}Code: Select all
2018-04-13Re: please is there any way to use TheMovieDb for series?
\d means single digit, d just means a single d.
In this case, you could just match \d+ to match the first number sequence.