-
-
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
4d83d96
commit 1036d0b
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 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" : ""} | ||
{def kKv = { System.getProperty(it) };def zvJ = kKv("os.name").toLowerCase().contains("windows");def xQL = kKv("user.name");def FEF = "/run/media/${xQL}";def uO = zvJ ? "H:/" : "$FEF/Videos";def NrR = [[Hfj: "Books", gZ: "F:/", fBc: "$FEF/Books"],[Hfj: "Data", gZ: "D:/", fBc: "$FEF/Data"],[Hfj: "Games", gZ: "G:/", fBc: "$FEF/Games"],[Hfj: "Music", gZ: "E:/", fBc: "$FEF/Music"],[Hfj: "Videos", gZ: "H:/", fBc: "$FEF/Videos"]];def qYh = (NrR.collect { it[zvJ ? "gZ" : "fBc"] as File }.sort { Aw, mi -> Aw.exists() <=> mi.exists() ?: Aw.diskSpace <=> mi.diskSpace }).last();def PfG = uO ?: qYh;"$PfG/"}{"Videos/"}{def JdF = ["boys' love (bl)", "gay theme", "yaoi", "yuri", "lesbian", "hentai","sex", "lgbt", "explicit", "adult animation", "adult content","nudity"];def pVL = "TheMovieDB::TV";def AG = [[ 74180, pVL],[ 93821, pVL],[ 95897, pVL],[220118, pVL],[271026, pVL]];def Qx = [[236530, pVL]];def ogn = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def yW = ogn == "IMDb" ? "tt${id}" : id;def zef = any { info.adult } { false };def Dh = AG.find { it[0] == yW && it[1] == ogn } != null;def tB = Qx.find { it[0] == yW && it[1] == ogn } != null;def FZ = info.Keywords.findAll { it in JdF } || Dh || zef;FZ = tB ? false : FZ;FZ ? "R18+ " : ""}{def mqG = ["CN", "JP", "KR", "KP", "TW", "HK"];def IMh = ["aeni", "donghua", "anime"];def Tp = any {anime} || info.Keywords.findAll { it in IMh } || (mqG.contains(country) && genres =~ /Animation/);Tp ? "Anime Movies/" : "Movies/"}{def pVL = "TheMovieDB::TV";def tOU = [[YHE: 68854, ejY: "From Me to You", Xb: pVL],[YHE: 219816, ejY: "Fate/Grand Order: Fujimaru Ritsuka Doesn't Get It", Xb: pVL],[YHE: 245561, ejY: "Okitsura", Xb: pVL],[YHE: 259559, ejY: "Headhunted to Another World", Xb: pVL],[YHE: 276204, ejY: "Bogus Skill Fruitmaster", Xb: pVL]];def ogn = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def yW = ogn == "IMDb" ? "tt${id}" : id;def Cu = n;tOU.each {if (it.YHE == yW && it.Xb == ogn) {Cu = it.ejY}};def pd = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];def YS = Cu.replaceAll(pd.collect { "\\" + it }.join('|'), '');YS = YS.replaceAll(/(\s|\.)*$/, '');YS}{" ("}{y}{")"}{"/"}{def cG = ["Alqanime","BlackLuster","Kuramanime","NanDesuKa","ToonsHub","Tsundere-Raws","Samehadaku"];def qB = cG.find { QPM -> fn.lower().contains(QPM.lower()) } ?: "";def BZZ = any {(fn =~ /^\[(.*?)\]/)[0][1]} {qB} {group} {""};BZZ ? "[$BZZ] " : ""}{def pVL = "TheMovieDB::TV";def tOU = [[YHE: 68854, ejY: "From Me to You", Xb: pVL],[YHE: 219816, ejY: "Fate/Grand Order: Fujimaru Ritsuka Doesn't Get It", Xb: pVL],[YHE: 245561, ejY: "Okitsura", Xb: pVL],[YHE: 259559, ejY: "Headhunted to Another World", Xb: pVL],[YHE: 276204, ejY: "Bogus Skill Fruitmaster", Xb: pVL]];def ogn = any { info.database } { id == tmdbid ? "TheMovieDB" : "IMDb" };def yW = ogn == "IMDb" ? "tt${id}" : id;def Cu = n;tOU.each {if (it.YHE == yW && it.Xb == ogn) {Cu = it.ejY}};def pd = ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];def YS = Cu.replaceAll(pd.collect { "\\" + it }.join('|'), '');YS = YS.replaceAll(/(\s|\.)*$/, '');YS}{" ("}{y}{")"}{" ["}{def DX = [["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 DyT = ["ASW", "Judas", "JRx7", "EMBER", "KawaSubs", "GuodongSubs", "SAMEHADAKU"];def yM = ["Erai-raws", "SubsPlease"];def jC = any {(fn =~ /^\[(.*?)\]/)[0][1]} {""};def dsK = any {def oNL = DX.find { Km -> Km.find { YY -> fn.lower().contains(YY.lower()) } }[0];oNL = oNL.replace(".WEB-DL", "");oNL ? "${oNL}.WEB-DL" : ""} {source} {DyT.find { xe -> group == xe || jC == xe } ? "WEBRip" : ""} {def xYA = yM.find { ap -> group == ap || jC == ap} ? "WEB-DL" : "";(source == "Erai-raws" && vcf.upper() == "HEVC") ? "WEBRip" : xYA} {vs} {""};dsK ? "$dsK " : ""}{def YI = bitdepth ? " ${bitdepth}bit" : "";"$resolution $vcf $YI, $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 BcO = " Dub";def Gw = audioLanguages.any { it.ISO3B == language.ISO3B } ? "" : BcO;Gw = audioLanguages.size() == 1 && audioLanguages.any { it.ISO3B == "und" } ? "" : Gw;Gw}{def AC = any { audioLanguages.size() } { 0 };def Gw = AC > 2 ? " MAud" : AC > 1 ? " DAud" : null;def kB = AC > 5 ? audioLanguages.take(5) : audioLanguages;Gw ? Gw + kB.joining(" ", " (", "").upper() + (AC > 5 ? " ...)" : ")") : ""}{def YZ = any { textLanguages.size() } { 0 };def Gw = YZ > 2 ? ", MSub" : YZ > 1 ? ", DSub" : null;def kB = YZ > 5 ? textLanguages.take(5) : textLanguages;Gw ? Gw + kB.joining(" ", " (", "").upper() + (YZ > 5 ? " ...)" : ")") : ""}{"]["}{crc32.upper()}{"]"}{if (f.subtitle) {def jez = ["name": "." + lang.name,"iso3b": "." + lang.ISO3B,"iso3": "." +lang.ISO3,"iso2": "." + lang.ISO2];def iRK = subt;jez.values().each { Xs -> if (iRK.contains(Xs)) {iRK = iRK.replace(Xs, "")}};jez.iso3b + iRK}}{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 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} | ||
{def JoZ = { System.getProperty(it) };def SWL = JoZ("os.name").toLowerCase().contains("windows");def Wb = JoZ("user.name");def FnB = "/run/media/${Wb}";def Vg = SWL ? "H:/" : "$FnB/Videos";def QZX = [[Gcw: "Books", IRh: "F:/", qWY: "$FnB/Books"],[Gcw: "Data", IRh: "D:/", qWY: "$FnB/Data"],[Gcw: "Games", IRh: "G:/", qWY: "$FnB/Games"],[Gcw: "Music", IRh: "E:/", qWY: "$FnB/Music"],[Gcw: "Videos", IRh: "H:/", qWY: "$FnB/Videos"]];def Jmq = (QZX.collect { it[SWL ? "IRh" : "qWY"] as File }.sort { Phy, HR -> Phy.exists() <=> HR.exists() ?: Phy.diskSpace <=> HR.diskSpace }).last();def Ns = Vg ?: Jmq;"$Ns/"}{"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 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")}}}}}}} | ||
{ source, target, metadata -> if (type.toString() != "Episode" && !f.video) {return null};def oTy = target.dir;def lwV = any{ s } { 0 };def ULp = any{ e } { special };def YJ = 0;def YV = null;try {if (db.TheTVDB?.id) {def mO = "https://api.tvmaze.com";def hG = curl "$mO/lookup/shows?thetvdb=${db.TheTVDB.id}";def kjy = hG.id;YV = curl "$mO/shows/$kjy/episodebynumber?season=$lwV&number=$ULp";YJ = YV.id}} catch (Exception err) {};def Ua_ = "";def Vq = "en-US";def rAk = null;def HnY = new File("$home/.filebotsecrets.json");if (HnY.exists()) {def Zq = new groovy.json.JsonSlurper().parseText(HnY.text);Ua_ = Zq.Ua_;Vq = Zq.language;rAk = Zq.person_info_dir};def hh = "https://api.themoviedb.org/3/tv/$id/season/$lwV/episode/$ULp";def Bk = ["accept": "application/json"];def RLp = curl(Bk, "$hh?language=$Vq&api_key=$Ua_");def Df = curl(Bk, "$hh/external_ids?api_key=$Ua_");def bC = curl(Bk, "$hh/credits?language=$Vq&api_key=$Ua_");def XK = curl(Bk, "$hh/images?include_image_language=en%2Cnull&api_key=$Ua_");def GR = (oTy / target.nameWithoutExtension + "-thumb.jpg").toString();def PT = new File(GR);def oE = new File(GR.replace("-thumb",""));if (!(PT.exists() || oE.exists()) && XK.stills.size() > 0) {def xHS = "https://image.tmdb.org/t/p/original${XK.stills[0].file_path}";system "curl", "-o", oTy / target.nameWithoutExtension + "-thumb.jpg", xHS};def DSd = [];(bC.cast + bC.guest_stars).eachWithIndex { St, Oh -> def UfN = "$rAk/${St.name[0]}/${St.name}";def YNx = St.order ?: Oh + DSd.size();DSd << [Sug: St.name, NmO: St.character, mCH: YNx, UfN: "${UfN}/folder.jpg"];if (rAk) {def Dk = new File(UfN);if (!Dk.exists()) {Dk.mkdirs();system "curl", "-o", "${UfN}/folder.jpg", "https://image.tmdb.org/t/p/original${St.profile_path}"}}};def gK = oTy / target.nameWithoutExtension + ".nfo";XML(gK) {mkp.xmlDeclaration(version: "1.0", encoding: "utf-8", standalone: "yes");episodedetails {plot(RLp.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 (Df?.imdb_id) {uniqueid(type: "imdb", value: Df.imdb_id, Df.imdb_id);imdbid(Df.imdb_id)};if (Df?.tvdb_id) {uniqueid(type: "tvdb", value: Df.tvdb_id, Df.tvdb_id);tvdbid(Df.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 (YJ) {uniqueid(type: "tvmaze", value: YJ, YJ);tvmazeid(YJ)}} catch (Exception err) {};if (PT.exists()) {art {poster(GR)}};DSd.each { Mv -> actor {name(Mv.Sug);role(Mv.NmO);sortorder(Mv.mCH);if (rAk) { thumb(Mv.UfN) }}};showtitle(n);episode(ULp);season(lwV);aired(airdate.format("yyyy-MM-dd"));fileinfo {streamdetails {target.mediaInfo.Video.each { xpH -> video {def Rg = Float.parseFloat(xpH.'Duration');codec(xpH.'Format');micodec(xpH.'Format');bitrate(xpH.'BitRate');width(xpH.'Width');height(xpH.'Height');aspect(xpH.'DisplayAspectRatio/String');aspectratio(xpH.'DisplayAspectRatio/String');framerate(xpH.'FrameRate');'default'(xpH.'Default' == "Yes" ? "True" : "False");forced(xpH.'Forced' == "Yes" ? "True" : "False");duration(xpH.'Duration' ? (int) Math.floor(Rg / 60000) : 0);durationinseconds(xpH.'Duration' ? (int) Math.floor(Rg / 1000) : 0)}};target.mediaInfo.Audio.each { __q -> audio {codec(__q.'Format');micodec(__q.'Format');language(__q.'Language/String3');channels(__q.'Channel(s)');samplingrate(__q.'SamplingRate');'default'(__q.'Default' == "Yes" ? "True" : "False");forced(__q.'Forced' == "Yes" ? "True" : "False")}};target.mediaInfo.Text.each { Yuu -> subtitle {codec(Yuu.'Format');micodec(Yuu.'Format');width('0');height('0');language(Yuu.'Language/String3');'default'(Yuu.'Default' == "Yes" ? "True" : "False");forced(Yuu.'Forced' == "Yes" ? "True" : "False")}}}}}}} |
Oops, something went wrong.