Skip to content

Commit

Permalink
Compile Groovy Scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 3, 2025
1 parent 7243b00 commit 110c46f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiled/movie.groovy
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{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" : ""}
{def DXd = { System.getProperty(it) };def FE = DXd("os.name").toLowerCase().contains("windows");def Ba = DXd("user.name");def lEC = "/run/media/${Ba}";def U_ = FE ? "H:/" : "$lEC/Videos";def ktb = [[aa: "Books", CP: "F:/", Ml: "$lEC/Books"],[aa: "Data", CP: "D:/", Ml: "$lEC/Data"],[aa: "Games", CP: "G:/", Ml: "$lEC/Games"],[aa: "Music", CP: "E:/", Ml: "$lEC/Music"],[aa: "Videos", CP: "H:/", Ml: "$lEC/Videos"]];def QQA = (ktb.collect { it[FE ? "CP" : "Ml"] as File }.sort { ZE, Alg -> ZE.exists() <=> Alg.exists() ?: ZE.diskSpace <=> Alg.diskSpace }).last();def QU = U_ ?: QQA;"$QU/"}{"Videos/"}{def ck_ = ["boys' love (bl)", "gay theme", "yaoi", "yuri", "lesbian", "hentai","sex", "lgbt", "explicit", "adult animation", "adult content","nudity"];def Rc = "TheMovieDB::TV";def RD = [[ 74180, Rc],[ 93821, Rc],[ 95897, Rc],[220118, Rc],[271026, Rc]];def KMT = [[236530, Rc]];def jn = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def n_ = jn == "IMDb" ? "tt${id}" : id;def uhK = any { info.adult } { false };def lA = RD.find { it[0] == n_ && it[1] == jn } != null;def aq = KMT.find { it[0] == n_ && it[1] == jn } != null;def Xt = info.Keywords.findAll { it in ck_ } || lA || uhK;Xt = aq ? false : Xt;Xt ? "R18+ " : ""}{def vOq = ["CN", "JP", "KR", "KP", "TW", "HK"];def WJU = ["aeni", "donghua", "anime"];def JZO = any {anime} || info.Keywords.findAll { it in WJU } || (vOq.contains(country) && genres =~ /Animation/);JZO ? "Anime Movies/" : "Movies/"}{def Rc = "TheMovieDB::TV";def QNO = [[XU: 68854, uZ: "From Me to You", Ix: Rc],[XU: 219816, uZ: "Fate/Grand Order: Fujimaru Ritsuka Doesn't Get It", Ix: Rc],[XU: 259559, uZ: "Headhunted to Another World", Ix: Rc],[XU: 276204, uZ: "Bogus Skill Fruitmaster", Ix: Rc]];def jn = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def n_ = jn == "IMDb" ? "tt${id}" : id;def nKh = n;QNO.each {if (it.XU == n_ && it.Ix == jn) {nKh = it.uZ}};def _K = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];def lhG = nKh.replaceAll(_K.collect { "\\" + it }.join('|'), '');lhG = lhG.replaceAll(/(\s|\.)*$/, '');lhG}{" ("}{y}{")"}{"/"}{def om_ = ["Alqanime","BlackLuster","Kuramanime","NanDesuKa","ToonsHub","Tsundere-Raws","Samehadaku"];def KFX = om_.find { vv -> fn.lower().contains(vv.lower()) } ?: "";def oe = any {(fn =~ /^\[(.*?)\]/)[0][1]} {KFX} {group} {""};oe ? "[$oe] " : ""}{def Rc = "TheMovieDB::TV";def QNO = [[XU: 68854, uZ: "From Me to You", Ix: Rc],[XU: 219816, uZ: "Fate/Grand Order: Fujimaru Ritsuka Doesn't Get It", Ix: Rc],[XU: 259559, uZ: "Headhunted to Another World", Ix: Rc],[XU: 276204, uZ: "Bogus Skill Fruitmaster", Ix: Rc]];def jn = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def n_ = jn == "IMDb" ? "tt${id}" : id;def nKh = n;QNO.each {if (it.XU == n_ && it.Ix == jn) {nKh = it.uZ}};def _K = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];def lhG = nKh.replaceAll(_K.collect { "\\" + it }.join('|'), '');lhG = lhG.replaceAll(/(\s|\.)*$/, '');lhG}{" ("}{y}{")"}{" ["}{def wPT = [["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 GGM = ["ASW", "Judas", "JRx7", "EMBER", "KawaSubs", "GuodongSubs", "SAMEHADAKU"];def RH = ["Erai-raws", "SubsPlease"];def FwT = any {(fn =~ /^\[(.*?)\]/)[0][1]} {""};def NV = any {def FXA = wPT.find { xp -> xp.find { NEE -> fn.lower().contains(NEE.lower()) } }[0];FXA = FXA.replace(".WEB-DL", "");FXA ? "${FXA}.WEB-DL" : ""} {source} {GGM.find { nsy -> group == nsy || FwT == nsy } ? "WEBRip" : ""} {def KM = RH.find { jVQ -> group == jVQ || FwT == jVQ} ? "WEB-DL" : "";(source == "Erai-raws" && vcf.upper() == "HEVC") ? "WEBRip" : KM} {vs} {""};NV ? "$NV " : ""}{def em = bitdepth ? " ${bitdepth}bit" : "";"$resolution $vcf $em, $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 gp = " Dub";def yw = audioLanguages.any { it.ISO3B == language.ISO3B } ? "" : gp;yw = audioLanguages.size() == 1 && audioLanguages.any { it.ISO3B == "und" } ? "" : yw;yw}{def gv = any { audioLanguages.size() } { 0 };def yw = gv > 2 ? " MAud" : gv > 1 ? " DAud" : null;def oXr = gv > 5 ? audioLanguages.take(5) : audioLanguages;yw ? yw + oXr.joining(" ", " (", "").upper() + (gv > 5 ? " ...)" : ")") : ""}{def UO = any { textLanguages.size() } { 0 };def yw = UO > 2 ? ", MSub" : UO > 1 ? ", DSub" : null;def oXr = UO > 5 ? textLanguages.take(5) : textLanguages;yw ? yw + oXr.joining(" ", " (", "").upper() + (UO > 5 ? " ...)" : ")") : ""}{"]["}{crc32.upper()}{"]"}{if (f.subtitle) {def qmS = ["name": "." + lang.name,"iso3b": "." + lang.ISO3B,"iso3": "." +lang.ISO3,"iso2": "." + lang.ISO2];def ig = subt;qmS.values().each { YBq -> if (ig.contains(YBq)) {ig = ig.replace(YBq, "")}};qmS.iso3b + ig}}{f.image ? "-thumb" : ""}
2 changes: 1 addition & 1 deletion compiled/music_shared.groovy
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{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}
{def Ssm = { System.getProperty(it) };def km = Ssm("os.name").toLowerCase().contains("windows");def oWy = Ssm("user.name");def Hbj = "/run/media/${oWy}";def SdG = km ? "H:/" : "$Hbj/Videos";def hJ = [[iG: "Books", QgF: "F:/", rDK: "$Hbj/Books"],[iG: "Data", QgF: "D:/", rDK: "$Hbj/Data"],[iG: "Games", QgF: "G:/", rDK: "$Hbj/Games"],[iG: "Music", QgF: "E:/", rDK: "$Hbj/Music"],[iG: "Videos", QgF: "H:/", rDK: "$Hbj/Videos"]];def kct = (hJ.collect { it[km ? "QgF" : "rDK"] as File }.sort { nE, cXw -> nE.exists() <=> cXw.exists() ?: nE.diskSpace <=> cXw.diskSpace }).last();def ok = SdG ?: kct;"$ok/"}{"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}
2 changes: 1 addition & 1 deletion compiled/post_xmbcnfo.groovy
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ 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")}}}}}}}
{ source, target, metadata -> if (type.toString() != "Episode" && !f.video) {return null};def OQB = target.dir;def Ksu = any{ s } { 0 };def LEI = any{ e } { special };def SMc = 0;def Re_ = null;try {if (db.TheTVDB?.id) {def vrF = "https://api.tvmaze.com";def cbh = curl "$vrF/lookup/shows?thetvdb=${db.TheTVDB.id}";def eb = cbh.id;Re_ = curl "$vrF/shows/$eb/episodebynumber?season=$Ksu&number=$LEI";SMc = Re_.id}} catch (Exception err) {};def lkU = "";def Xa = "en-US";def CR = null;def GF = new File("$home/.filebotsecrets.json");if (GF.exists()) {def iXG = new groovy.json.JsonSlurper().parseText(GF.text);lkU = iXG.lkU;Xa = iXG.language;CR = iXG.person_info_dir};def cLs = "https://api.themoviedb.org/3/tv/$id/season/$Ksu/episode/$LEI";def Pu = ["accept": "application/json"];def YY = curl(Pu, "$cLs?language=$Xa&api_key=$lkU");def tT = curl(Pu, "$cLs/external_ids?api_key=$lkU");def HRh = curl(Pu, "$cLs/credits?language=$Xa&api_key=$lkU");def pwI = curl(Pu, "$cLs/images?include_image_language=en%2Cnull&api_key=$lkU");def OS = (OQB / target.nameWithoutExtension + "-thumb.jpg").toString();def BJ = new File(OS);def YVv = new File(OS.replace("-thumb",""));if (!(BJ.exists() || YVv.exists()) && pwI.stills.size() > 0) {def Nk = "https://image.tmdb.org/t/p/original${pwI.stills[0].file_path}";system "curl", "-o", OQB / target.nameWithoutExtension + "-thumb.jpg", Nk};def CBN = [];(HRh.cast + HRh.guest_stars).eachWithIndex { KAd, wO -> def My = "$CR/${KAd.name[0]}/${KAd.name}";def RHC = KAd.order ?: wO + CBN.size();CBN << [MQD: KAd.name, JS: KAd.character, CJg: RHC, My: "${My}/folder.jpg"];if (CR) {def vcM = new File(My);if (!vcM.exists()) {vcM.mkdirs();system "curl", "-o", "${My}/folder.jpg", "https://image.tmdb.org/t/p/original${KAd.profile_path}"}}};def VRR = OQB / target.nameWithoutExtension + ".nfo";XML(VRR) {mkp.xmlDeclaration(version: "1.0", encoding: "utf-8", standalone: "yes");episodedetails {plot(YY.overview);lockdata("false");dateadded(new Date().format("yyyy-xw-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 (tT?.imdb_id) {uniqueid(type: "imdb", value: tT.imdb_id, tT.imdb_id);imdbid(tT.imdb_id)};if (tT?.tvdb_id) {uniqueid(type: "tvdb", value: tT.tvdb_id, tT.tvdb_id);tvdbid(tT.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 (SMc) {uniqueid(type: "tvmaze", value: SMc, SMc);tvmazeid(SMc)}} catch (Exception err) {};if (BJ.exists()) {art {poster(OS)}};CBN.each { TTr -> actor {name(TTr.MQD);role(TTr.JS);sortorder(TTr.CJg);if (CR) { thumb(TTr.My) }}};showtitle(n);episode(LEI);season(Ksu);aired(airdate.format("yyyy-xw-dd"));fileinfo {streamdetails {target.mediaInfo.Video.each { hf -> video {def GDj = Float.parseFloat(hf.'Duration');codec(hf.'Format');micodec(hf.'Format');bitrate(hf.'BitRate');width(hf.'Width');height(hf.'Height');aspect(hf.'DisplayAspectRatio/String');aspectratio(hf.'DisplayAspectRatio/String');framerate(hf.'FrameRate');'default'(hf.'Default' == "Yes" ? "True" : "False");forced(hf.'Forced' == "Yes" ? "True" : "False");duration(hf.'Duration' ? (int) Math.floor(GDj / 60000) : 0);durationinseconds(hf.'Duration' ? (int) Math.floor(GDj / 1000) : 0)}};target.mediaInfo.Audio.each { xw -> audio {codec(xw.'Format');micodec(xw.'Format');language(xw.'Language/String3');channels(xw.'Channel(s)');samplingrate(xw.'SamplingRate');'default'(xw.'Default' == "Yes" ? "True" : "False");forced(xw.'Forced' == "Yes" ? "True" : "False")}};target.mediaInfo.Text.each { nuz -> subtitle {codec(nuz.'Format');micodec(nuz.'Format');width('0');height('0');language(nuz.'Language/String3');'default'(nuz.'Default' == "Yes" ? "True" : "False");forced(nuz.'Forced' == "Yes" ? "True" : "False")}}}}}}}
Loading

0 comments on commit 110c46f

Please sign in to comment.