-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc3aec8
commit d3c8945
Showing
4 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{def cC = { System.getProperty(it) };def Mpt = cC("os.name").toLowerCase().contains("windows");def dQ = cC("user.name");def cR = "/run/media/${dQ}";def KY = Mpt ? "H:/" : "$cR/Videos";def ch = [[TNy: "Books", yTk: "F:/", FO: "$cR/Books"],[TNy: "Data", yTk: "D:/", FO: "$cR/Data"],[TNy: "Games", yTk: "G:/", FO: "$cR/Games"],[TNy: "Music", yTk: "E:/", FO: "$cR/Music"],[TNy: "Videos", yTk: "H:/", FO: "$cR/Videos"]];def bJk = (ch.collect { it[Mpt ? "yTk" : "FO"] as File }.sort { Nl, ZyH -> Nl.exists() <=> ZyH.exists() ?: Nl.diskSpace <=> ZyH.diskSpace }).last();def mZ = KY ?: bJk;"$mZ/"}{"Videos/"}{def kC_ = ["boys' love (bl)", "gay theme", "yaoi", "yuri", "lesbian", "hentai","sex", "lgbt", "explicit", "adult animation", "adult content","nudity"];def YM = "TheMovieDB::TV";def OQd = [[ 74180, YM],[ 93821, YM],[ 95897, YM],[220118, YM],[271026, YM]];def yZq = [[236530, YM]];def QY = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def XaK = QY == "IMDb" ? "tt${id}" : id;def XlW = any { info.adult } { false };def Ng = OQd.find { it[0] == XaK && it[1] == QY } != null;def YKh = yZq.find { it[0] == XaK && it[1] == QY } != null;def hF = info.Keywords.findAll { it in kC_ } || Ng || XlW;hF = YKh ? false : hF;hF ? "R18+ " : ""}{def AqJ = ["CN", "JP", "KR", "KP", "TW", "HK"];def iv = ["aeni", "donghua", "anime"];def ppp = any {anime} || info.Keywords.findAll { it in iv } || (AqJ.contains(country) && genres =~ /Animation/);ppp ? "Anime Movies/" : "Movies/"}{def YM = "TheMovieDB::TV";def cde = [[zul: 68854, YJ: "From Me to You", DYw: YM],[zul: 219816, YJ: "Fate/Grand Order: Fujimaru Ritsuka Doesn't Get It", DYw: YM],[zul: 259559, YJ: "Headhunted to Another World", DYw: YM],[zul: 276204, YJ: "Bogus Skill Fruitmaster", DYw: YM]];def QY = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def XaK = QY == "IMDb" ? "tt${id}" : id;def iO = n;cde.each {if (it.zul == XaK && it.DYw == QY) {iO = it.YJ}};def wFj = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];def NUQ = iO.replaceAll(wFj.collect { "\\" + it }.join('|'), '');NUQ = NUQ.replaceAll(/(\s|\.)*$/, '');NUQ}{" ("}{y}{")"}{"/"}{def VLX = ["Alqanime","BlackLuster","Kuramanime","NanDesuKa","ToonsHub","Tsundere-Raws","Samehadaku"];def nHN = VLX.find { v_k -> fn.lower().contains(v_k.lower()) } ?: "";def klH = any {(fn =~ /^\[(.*?)\]/)[0][1]} {nHN} {group} {""};klH ? "[$klH] " : ""}{def YM = "TheMovieDB::TV";def cde = [[zul: 68854, YJ: "From Me to You", DYw: YM],[zul: 219816, YJ: "Fate/Grand Order: Fujimaru Ritsuka Doesn't Get It", DYw: YM],[zul: 259559, YJ: "Headhunted to Another World", DYw: YM],[zul: 276204, YJ: "Bogus Skill Fruitmaster", DYw: YM]];def QY = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def XaK = QY == "IMDb" ? "tt${id}" : id;def iO = n;cde.each {if (it.zul == XaK && it.DYw == QY) {iO = it.YJ}};def wFj = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];def NUQ = iO.replaceAll(wFj.collect { "\\" + it }.join('|'), '');NUQ = NUQ.replaceAll(/(\s|\.)*$/, '');NUQ}{" ("}{y}{")"}{" ["}{def fH = [["ABEMA"],["ADN"],["BBC"],["BILI", "B-Global", "BiliIntl", "B-Site", "BiliCN"],["COOLMIC"],["HIDIVE", "HIDI.WEB-DL"],["IQIYI", "IQ.WEB-DL"],["JFFP"],["LAFTEL", "LFTL"],["MDON", "MANGADON"],["MW.WEB-DL"],["NF.WEB-DL", "NF WEB"],["SHAHID"],["TVER"],["UNEXT"],["WETV"],["YT.WEB-DL", "YOUTUBE", "YTB"]];def rJr = ["ASW", "Judas", "JRx7", "EMBER", "KawaSubs", "GuodongSubs", "SAMEHADAKU"];def oL = ["Erai-raws", "SubsPlease"];def LWO = any {(fn =~ /^\[(.*?)\]/)[0][1]} {""};def sR = any {def Gc = fH.find { HJ -> HJ.find { uh -> fn.lower().contains(uh.lower()) } }[0];Gc = Gc.replace(".WEB-DL", "");def qWx = source.contains("WEB-DL");def pn = source ? ".${source}" : "";qWx ? "${Gc}.WEB-DL" : Gc ? "${Gc}${pn}" : ""} {} {source} {rJr.find { cUS -> group == cUS || LWO == cUS } ? "WEBRip" : ""} {def ql = oL.find { Ywm -> group == Ywm || LWO == Ywm} ? "WEB-DL" : "";(source == "Erai-raws" && vcf.upper() == "HEVC") ? "WEBRip" : ql} {vs} {""};sR ? "$sR " : ""}{def udy = bitdepth ? " ${bitdepth}bit" : "";"$resolution $vcf $udy, $ac"}{" "}{af.format(8: 'DD+ 7.1',7: '6.1',6: 'DD 5.1',5: '5.0',3: '2.1',2: '2.0',1: '1.0')}{def CV = " Dub";def An = audioLanguages.any { it.ISO3B == language.ISO3B } ? "" : CV;An = audioLanguages.size() == 1 && audioLanguages.any { it.ISO3B == "und" } ? "" : An;An}{def Zf = any { audioLanguages.size() } { 0 };def An = Zf > 2 ? " MAud" : Zf > 1 ? " DAud" : null;def jCD = Zf > 5 ? audioLanguages.take(5) : audioLanguages;An ? An + jCD.joining(" ", " (", "").upper() + (Zf > 5 ? " ...)" : ")") : ""}{def Gi = any { textLanguages.size() } { 0 };def An = Gi > 2 ? ", MSub" : Gi > 1 ? ", DSub" : null;def jCD = Gi > 5 ? textLanguages.take(5) : textLanguages;An ? An + jCD.joining(" ", " (", "").upper() + (Gi > 5 ? " ...)" : ")") : ""}{"]["}{crc32.upper()}{"]"}{if (f.subtitle) {def Kro = ["name": "." + lang.name,"iso3b": "." + lang.ISO3B,"iso3": "." +lang.ISO3,"iso2": "." + lang.ISO2];def hA = subt;Kro.values().each { NF -> if (hA.contains(NF)) {hA = hA.replace(NF, "")}};Kro.iso3b + hA}}{f.image ? "-thumb" : ""} | ||
{def OJ = { System.getProperty(it) };def yb = OJ("os.name").toLowerCase().contains("windows");def Mxt = OJ("user.name");def do = "/run/media/${Mxt}";def Ox = yb ? "H:/" : "$do/Videos";def yX = [[HpK: "Books", taF: "F:/", Zp: "$do/Books"],[HpK: "Data", taF: "D:/", Zp: "$do/Data"],[HpK: "Games", taF: "G:/", Zp: "$do/Games"],[HpK: "Music", taF: "E:/", Zp: "$do/Music"],[HpK: "Videos", taF: "H:/", Zp: "$do/Videos"]];def kHo = (yX.collect { it[yb ? "taF" : "Zp"] as File }.sort { kA, wbU -> kA.exists() <=> wbU.exists() ?: kA.diskSpace <=> wbU.diskSpace }).last();def go = Ox ?: kHo;"$go/"}{"Videos/"}{def ip = ["boys' love (bl)", "gay theme", "yaoi", "yuri", "lesbian", "hentai","sex", "lgbt", "explicit", "adult animation", "adult content","nudity"];def js = "TheMovieDB::TV";def wV = [[ 74180, js],[ 93821, js],[ 95897, js],[220118, js],[271026, js]];def oA = [[236530, js]];def iw = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def Ub = iw == "IMDb" ? "tt${id}" : id;def zP = any { info.adult } { false };def gf = wV.find { it[0] == Ub && it[1] == iw } != null;def Zlm = oA.find { it[0] == Ub && it[1] == iw } != null;def PL = info.Keywords.findAll { it in ip } || gf || zP;PL = Zlm ? false : PL;PL ? "R18+ " : ""}{def Et = ["CN", "JP", "KR", "KP", "TW", "HK"];def sX = ["aeni", "donghua", "anime"];def My = any {anime} || info.Keywords.findAll { it in sX } || (Et.contains(country) && genres =~ /Animation/);My ? "Anime Movies/" : "Movies/"}{def js = "TheMovieDB::TV";def yv = [[Fr: 68854, xIB: "From Me to You", Kmr: js],[Fr: 219816, xIB: "Fate/Grand Order: Fujimaru Ritsuka Doesn't Get It", Kmr: js],[Fr: 259559, xIB: "Headhunted to Another World", Kmr: js],[Fr: 276204, xIB: "Bogus Skill Fruitmaster", Kmr: js]];def iw = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def Ub = iw == "IMDb" ? "tt${id}" : id;def NG = n;yv.each {if (it.Fr == Ub && it.Kmr == iw) {NG = it.xIB}};def fYM = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];def Fq = NG.replaceAll(fYM.collect { "\\" + it }.join('|'), '');Fq = Fq.replaceAll(/(\s|\.)*$/, '');Fq}{" ("}{y}{")"}{"/"}{def Pi = ["Alqanime","BlackLuster","Kuramanime","NanDesuKa","ToonsHub","Tsundere-Raws","Samehadaku"];def GXS = Pi.find { VjH -> fn.lower().contains(VjH.lower()) } ?: "";def avC = any {(fn =~ /^\[(.*?)\]/)[0][1]} {GXS} {group} {""};avC ? "[$avC] " : ""}{def js = "TheMovieDB::TV";def yv = [[Fr: 68854, xIB: "From Me to You", Kmr: js],[Fr: 219816, xIB: "Fate/Grand Order: Fujimaru Ritsuka Doesn't Get It", Kmr: js],[Fr: 259559, xIB: "Headhunted to Another World", Kmr: js],[Fr: 276204, xIB: "Bogus Skill Fruitmaster", Kmr: js]];def iw = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def Ub = iw == "IMDb" ? "tt${id}" : id;def NG = n;yv.each {if (it.Fr == Ub && it.Kmr == iw) {NG = it.xIB}};def fYM = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];def Fq = NG.replaceAll(fYM.collect { "\\" + it }.join('|'), '');Fq = Fq.replaceAll(/(\s|\.)*$/, '');Fq}{" ("}{y}{")"}{" ["}{def sZ = [["ABEMA"],["ADN"],["BBC"],["BILI", "B-Global", "BiliIntl", "B-Site", "BiliCN"],["COOLMIC"],["HIDIVE", "HIDI.WEB-DL"],["IQIYI", "IQ.WEB-DL"],["JFFP"],["LAFTEL", "LFTL"],["MDON", "MANGADON"],["MW.WEB-DL"],["NF.WEB-DL", "NF WEB"],["SHAHID"],["TVER"],["UNEXT"],["WETV"],["YTB", "YT.WEB-DL", "YOUTUBE"]];def TfN = ["ASW", "Judas", "JRx7", "EMBER", "KawaSubs", "GuodongSubs", "SAMEHADAKU"];def Vi = ["Erai-raws", "SubsPlease"];def fUL = any {(fn =~ /^\[(.*?)\]/)[0][1]} {""};def htD = any {def W_ = sZ.find { FGW -> FGW.find { op -> fn.lower().contains(op.lower()) } }[0];W_ = W_.replace(".WEB-DL", "");def Msw = source.contains("WEB-DL");def RVG = source ? ".${source}" : "";Msw ? "${W_}.WEB-DL" : W_ ? "${W_}${RVG}" : ""} {fUL == "BiliIntl" ? "BILI.WEB-DL" : ""} {source} {TfN.find { c_S -> group == c_S || fUL == c_S } ? "WEBRip" : ""} {def aw = Vi.find { SDe -> group == SDe || fUL == SDe} ? "WEB-DL" : "";(source == "Erai-raws" && vcf.upper() == "HEVC") ? "WEBRip" : aw} {vs} {""};htD ? "$htD " : ""}{def UN = bitdepth ? " ${bitdepth}bit" : "";"$resolution $vcf $UN, $ac"}{" "}{af.format(8: 'DD+ 7.1',7: '6.1',6: 'DD 5.1',5: '5.0',3: '2.1',2: '2.0',1: '1.0')}{def Vx = " Dub";def aIK = audioLanguages.any { it.ISO3B == language.ISO3B } ? "" : Vx;aIK = audioLanguages.size() == 1 && audioLanguages.any { it.ISO3B == "und" } ? "" : aIK;aIK}{def pTk = any { audioLanguages.size() } { 0 };def aIK = pTk > 2 ? " MAud" : pTk > 1 ? " DAud" : null;def rAN = pTk > 5 ? audioLanguages.take(5) : audioLanguages;aIK ? aIK + rAN.joining(" ", " (", "").upper() + (pTk > 5 ? " ...)" : ")") : ""}{def Ka = any { textLanguages.size() } { 0 };def aIK = Ka > 2 ? ", MSub" : Ka > 1 ? ", DSub" : null;def rAN = Ka > 5 ? textLanguages.take(5) : textLanguages;aIK ? aIK + rAN.joining(" ", " (", "").upper() + (Ka > 5 ? " ...)" : ")") : ""}{"]["}{crc32.upper()}{"]"}{if (f.subtitle) {def WR = ["name": "." + lang.name,"iso3b": "." + lang.ISO3B,"iso3": "." +lang.ISO3,"iso2": "." + lang.ISO2];def GC = subt;WR.values().each { VUy -> if (GC.contains(VUy)) {GC = GC.replace(VUy, "")}};WR.iso3b + GC}}{f.image ? "-thumb" : ""} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{def RU = { System.getProperty(it) };def CAT = RU("os.name").toLowerCase().contains("windows");def CoB = RU("user.name");def yc = "/run/media/${CoB}";def lYg = CAT ? "H:/" : "$yc/Videos";def hZ = [[BY: "Books", Fa: "F:/", AN: "$yc/Books"],[BY: "Data", Fa: "D:/", AN: "$yc/Data"],[BY: "Games", Fa: "G:/", AN: "$yc/Games"],[BY: "Music", Fa: "E:/", AN: "$yc/Music"],[BY: "Videos", Fa: "H:/", AN: "$yc/Videos"]];def xa = (hZ.collect { it[CAT ? "Fa" : "AN"] as File }.sort { O_, ro -> O_.exists() <=> ro.exists() ?: O_.diskSpace <=> ro.diskSpace }).last();def Jzx = lYg ?: xa;"$Jzx/"}{"Torrent Uploads/"}{ext.upper()}{"/"}{y}{"/["}{d.format("yyyy.MM.dd")}{"] "}{album}{" - "}{n}{" ["}{ext.upper()}{ext == "flac" ? " " + "${ bitdepth > 16 ? bitdepth + '-' : ''}" + khz : ext == "mp3" && media.get("OverallBitRate/String") != "320 kbps" ? " V0" : ""}{"]"}{media.CATALOGNUMBER ? "[" + media.CATALOGNUMBER + "]" : ""}{"/"}{dc > 1 ? "Disc " + di + "/" : ""}{dc? di + "-": ""}{pi.pad(2)}{" "}{t} | ||
{def rLH = { System.getProperty(it) };def Cuh = rLH("os.name").toLowerCase().contains("windows");def aJ = rLH("user.name");def vpI = "/run/media/${aJ}";def Df = Cuh ? "H:/" : "$vpI/Videos";def kwy = [[GGw: "Books", AS: "F:/", Syf: "$vpI/Books"],[GGw: "Data", AS: "D:/", Syf: "$vpI/Data"],[GGw: "Games", AS: "G:/", Syf: "$vpI/Games"],[GGw: "Music", AS: "E:/", Syf: "$vpI/Music"],[GGw: "Videos", AS: "H:/", Syf: "$vpI/Videos"]];def qG = (kwy.collect { it[Cuh ? "AS" : "Syf"] as File }.sort { BP, Ps -> BP.exists() <=> Ps.exists() ?: BP.diskSpace <=> Ps.diskSpace }).last();def _R = Df ?: qG;"$_R/"}{"Torrent Uploads/"}{ext.upper()}{"/"}{y}{"/["}{d.format("yyyy.MM.dd")}{"] "}{album}{" - "}{n}{" ["}{ext.upper()}{ext == "flac" ? " " + "${ bitdepth > 16 ? bitdepth + '-' : ''}" + khz : ext == "mp3" && media.get("OverallBitRate/String") != "320 kbps" ? " V0" : ""}{"]"}{media.CATALOGNUMBER ? "[" + media.CATALOGNUMBER + "]" : ""}{"/"}{dc > 1 ? "Disc " + di + "/" : ""}{dc? di + "-": ""}{pi.pad(2)}{" "}{t} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ source, target, metadata -> if (type.toString() != "Episode" && !f.video) {return null};def vQ = target.dir;def uQ = any{ s } { 0 };def LyS = any{ e } { special };def YsY = 0;def OVf = null;try {if (db.TheTVDB?.id) {def grn = "https://api.tvmaze.com";def EvU = curl "$grn/lookup/shows?thetvdb=${db.TheTVDB.id}";def jOK = EvU.id;OVf = curl "$grn/shows/$jOK/episodebynumber?season=$uQ&number=$LyS";YsY = OVf.id}} catch (Exception err) {};def UEd = "";def KL = "en-US";def lb = null;def nl = new File("$home/.filebotsecrets.json");if (nl.exists()) {def EPS = new groovy.json.JsonSlurper().parseText(nl.text);UEd = EPS.UEd;KL = EPS.language;lb = EPS.person_info_dir};def bqW = "https://api.themoviedb.org/3/tv/$id/season/$uQ/episode/$LyS";def jVF = ["accept": "application/json"];def UCU = curl(jVF, "$bqW?language=$KL&api_key=$UEd");def CIZ = curl(jVF, "$bqW/external_ids?api_key=$UEd");def oJr = curl(jVF, "$bqW/credits?language=$KL&api_key=$UEd");def mT = curl(jVF, "$bqW/images?include_image_language=en%2Cnull&api_key=$UEd");def rVT = (vQ / target.nameWithoutExtension + "-thumb.jpg").toString();def gsx = new File(rVT);def jDP = new File(rVT.replace("-thumb",""));if (!(gsx.exists() || jDP.exists()) && mT.stills.size() > 0) {def CG = "https://image.tmdb.org/t/p/original${mT.stills[0].file_path}";system "curl", "-o", vQ / target.nameWithoutExtension + "-thumb.jpg", CG};def wR_ = [];(oJr.cast + oJr.guest_stars).eachWithIndex { paf, fuj -> def VWI = "$lb/${paf.name[0]}/${paf.name}";def dP = paf.order ?: fuj + wR_.size();wR_ << [gdJ: paf.name, WbT: paf.character, du: dP, VWI: "${VWI}/folder.jpg"];if (lb) {def Mc = new File(VWI);if (!Mc.exists()) {Mc.mkdirs();system "curl", "-o", "${VWI}/folder.jpg", "https://image.tmdb.org/t/p/original${paf.profile_path}"}}};def HTX = vQ / target.nameWithoutExtension + ".nfo";XML(HTX) {mkp.xmlDeclaration(version: "1.0", encoding: "utf-8", standalone: "yes");episodedetails {plot(UCU.overview);lockdata("false");dateadded(new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("UTC")));title(t);originaltitle(localize."${languages[0]}".t);rating(rating);year(airdate.format("yyyy"));uniqueid(type: "tmdb", value: episode.id, 'default': "true", episode.id);tmdbid(episode.id);if (CIZ?.imdb_id) {uniqueid(type: "imdb", value: CIZ.imdb_id, CIZ.imdb_id);imdbid(CIZ.imdb_id)};if (CIZ?.tvdb_id) {uniqueid(type: "tvdb", value: CIZ.tvdb_id, CIZ.tvdb_id);tvdbid(CIZ.tvdb_id)};try {runtime(runtime)} catch (Exception err) {runtime(minutes)};try {if (db.AniDB?.episode?.id) {uniqueid(type: "anidb", value: db.AniDB.episode.id, db.AniDB.episode.id);anidbid(db.AniDB.episode.id)}} catch (Exception err) {};try {if (YsY) {uniqueid(type: "tvmaze", value: YsY, YsY);tvmazeid(YsY)}} catch (Exception err) {};if (gsx.exists()) {art {poster(rVT)}};wR_.each { ze -> actor {name(ze.gdJ);role(ze.WbT);sortorder(ze.du);if (lb) { thumb(ze.VWI) }}};showtitle(n);episode(LyS);season(uQ);aired(airdate.format("yyyy-MM-dd"));fileinfo {streamdetails {target.mediaInfo.Video.each { vU -> video {def FRP = Float.parseFloat(vU.'Duration');codec(vU.'Format');micodec(vU.'Format');bitrate(vU.'BitRate');width(vU.'Width');height(vU.'Height');aspect(vU.'DisplayAspectRatio/String');aspectratio(vU.'DisplayAspectRatio/String');framerate(vU.'FrameRate');'default'(vU.'Default' == "Yes" ? "True" : "False");forced(vU.'Forced' == "Yes" ? "True" : "False");duration(vU.'Duration' ? (int) Math.floor(FRP / 60000) : 0);durationinseconds(vU.'Duration' ? (int) Math.floor(FRP / 1000) : 0)}};target.mediaInfo.Audio.each { znG -> audio {codec(znG.'Format');micodec(znG.'Format');language(znG.'Language/String3');channels(znG.'Channel(s)');samplingrate(znG.'SamplingRate');'default'(znG.'Default' == "Yes" ? "True" : "False");forced(znG.'Forced' == "Yes" ? "True" : "False")}};target.mediaInfo.Text.each { pnu -> subtitle {codec(pnu.'Format');micodec(pnu.'Format');width('0');height('0');language(pnu.'Language/String3');'default'(pnu.'Default' == "Yes" ? "True" : "False");forced(pnu.'Forced' == "Yes" ? "True" : "False")}}}}}}} | ||
{ source, target, metadata -> if (type.toString() != "Episode" && !f.video) {return null};def cg = target.dir;def Vmj = any{ s } { 0 };def vx = any{ e } { special };def SgF = 0;def Wv = null;try {if (db.TheTVDB?.id) {def nPo = "https://api.tvmaze.com";def lP = curl "$nPo/lookup/shows?thetvdb=${db.TheTVDB.id}";def Ah = lP.id;Wv = curl "$nPo/shows/$Ah/episodebynumber?season=$Vmj&number=$vx";SgF = Wv.id}} catch (Exception err) {};def LRD = "";def Sx = "en-US";def Mn = null;def XzH = new File("$home/.filebotsecrets.json");if (XzH.exists()) {def IYA = new groovy.json.JsonSlurper().parseText(XzH.text);LRD = IYA.LRD;Sx = IYA.language;Mn = IYA.person_info_dir};def Vo = "https://api.themoviedb.org/3/tv/$id/season/$Vmj/episode/$vx";def jc = ["accept": "application/json"];def QnU = curl(jc, "$Vo?language=$Sx&api_key=$LRD");def EJU = curl(jc, "$Vo/external_ids?api_key=$LRD");def kWj = curl(jc, "$Vo/credits?language=$Sx&api_key=$LRD");def NY = curl(jc, "$Vo/images?include_image_language=en%2Cnull&api_key=$LRD");def Wk = (cg / target.nameWithoutExtension + "-thumb.jpg").toString();def hJU = new File(Wk);def dX = new File(Wk.replace("-thumb",""));if (!(hJU.exists() || dX.exists()) && NY.stills.size() > 0) {def RDJ = "https://image.tmdb.org/t/p/original${NY.stills[0].file_path}";system "curl", "-o", cg / target.nameWithoutExtension + "-thumb.jpg", RDJ};def SYC = [];(kWj.cast + kWj.guest_stars).eachWithIndex { BFp, vVh -> def zmb = "$Mn/${BFp.name[0]}/${BFp.name}";def Vb = BFp.order ?: vVh + SYC.size();SYC << [Myt: BFp.name, pD: BFp.character, Ztp: Vb, zmb: "${zmb}/folder.jpg"];if (Mn) {def VMG = new File(zmb);if (!VMG.exists()) {VMG.mkdirs();system "curl", "-o", "${zmb}/folder.jpg", "https://image.tmdb.org/t/p/original${BFp.profile_path}"}}};def iX = cg / target.nameWithoutExtension + ".nfo";XML(iX) {mkp.xmlDeclaration(version: "1.0", encoding: "utf-8", standalone: "yes");episodedetails {plot(QnU.overview);lockdata("false");dateadded(new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("UTC")));title(t);originaltitle(localize."${languages[0]}".t);rating(rating);year(airdate.format("yyyy"));uniqueid(type: "tmdb", value: episode.id, 'default': "true", episode.id);tmdbid(episode.id);if (EJU?.imdb_id) {uniqueid(type: "imdb", value: EJU.imdb_id, EJU.imdb_id);imdbid(EJU.imdb_id)};if (EJU?.tvdb_id) {uniqueid(type: "tvdb", value: EJU.tvdb_id, EJU.tvdb_id);tvdbid(EJU.tvdb_id)};try {runtime(runtime)} catch (Exception err) {runtime(minutes)};try {if (db.AniDB?.episode?.id) {uniqueid(type: "anidb", value: db.AniDB.episode.id, db.AniDB.episode.id);anidbid(db.AniDB.episode.id)}} catch (Exception err) {};try {if (SgF) {uniqueid(type: "tvmaze", value: SgF, SgF);tvmazeid(SgF)}} catch (Exception err) {};if (hJU.exists()) {art {poster(Wk)}};SYC.each { Ir -> actor {name(Ir.Myt);role(Ir.pD);sortorder(Ir.Ztp);if (Mn) { thumb(Ir.zmb) }}};showtitle(n);episode(vx);season(Vmj);aired(airdate.format("yyyy-MM-dd"));fileinfo {streamdetails {target.mediaInfo.Video.each { W_ -> video {def FIv = Float.parseFloat(W_.'Duration');codec(W_.'Format');micodec(W_.'Format');bitrate(W_.'BitRate');width(W_.'Width');height(W_.'Height');aspect(W_.'DisplayAspectRatio/String');aspectratio(W_.'DisplayAspectRatio/String');framerate(W_.'FrameRate');'default'(W_.'Default' == "Yes" ? "True" : "False");forced(W_.'Forced' == "Yes" ? "True" : "False");duration(W_.'Duration' ? (int) Math.floor(FIv / 60000) : 0);durationinseconds(W_.'Duration' ? (int) Math.floor(FIv / 1000) : 0)}};target.mediaInfo.Audio.each { Vm -> audio {codec(Vm.'Format');micodec(Vm.'Format');language(Vm.'Language/String3');channels(Vm.'Channel(s)');samplingrate(Vm.'SamplingRate');'default'(Vm.'Default' == "Yes" ? "True" : "False");forced(Vm.'Forced' == "Yes" ? "True" : "False")}};target.mediaInfo.Text.each { mw -> subtitle {codec(mw.'Format');micodec(mw.'Format');width('0');height('0');language(mw.'Language/String3');'default'(mw.'Default' == "Yes" ? "True" : "False");forced(mw.'Forced' == "Yes" ? "True" : "False")}}}}}}} |
Oops, something went wrong.