From 0d929bea49edce7f9495bd0047f9c6055bbbb382 Mon Sep 17 00:00:00 2001 From: xeviff <73612508+xeviff@users.noreply.github.com> Date: Mon, 19 Jun 2023 22:17:35 +0200 Subject: [PATCH] bk --- Series_Rescue.groovy | 12 +++++++++++ common/classification.groovy | 37 ++++++++------------------------ common/functions.groovy | 2 +- common/video.groovy | 22 +++++++++++++------ movies/folder_file.groovy | 41 ++++++++++++++++++------------------ series/folder_file.groovy | 2 +- series/root_folders.groovy | 33 +++++++++++++++++------------ 7 files changed, 79 insertions(+), 70 deletions(-) create mode 100755 Series_Rescue.groovy diff --git a/Series_Rescue.groovy b/Series_Rescue.groovy new file mode 100755 index 0000000..78410be --- /dev/null +++ b/Series_Rescue.groovy @@ -0,0 +1,12 @@ +{ +def relocation=true +@series/root_folders.groovy +@common/validations.groovy +@common/video.groovy +@common/audio.groovy +@common/subs.groovy +@common/classification.groovy +@series/folder_file.groovy +@common/catch.groovy +@common/functions.groovy +} \ No newline at end of file diff --git a/common/classification.groovy b/common/classification.groovy index 8e505a9..dd92afb 100755 --- a/common/classification.groovy +++ b/common/classification.groovy @@ -85,13 +85,14 @@ if (!tipoYaSeteado && llenguaOriginal=="es" && !soloLangIngles) { // latina *** def latinWhitelist = {try{info.ProductionCompanies.any{it=~/Corazón Films/}} catch(e){false} }() || {try{["Kenya Marquez"].any{director==it}}catch(err){false}}() - def latinBlacklist = ["nightmare radio"].any{ localize.Spanish.n.toLowerCase().contains(it) } if (latinWhitelist) { latina = true - } else if (latinBlacklist || ({ try { info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b|\bAntena 3\b/ } catch (e) { false } }() - || ({ try { info.ProductionCompanies.any{it =~ /.?TVE|ESDIP|Canal Sur|Canal\+|Telecinco/}}catch(e){false}}())) - /*en seguiment*/|| numPaises == 0) { + } else if (["nightmare radio"].any{ localize.Spanish.n.toLowerCase().contains(it) } + || numPaises == 0 /*en seguiment*/ + || {try{ info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b|\bAntena 3\b/ }catch(e){ false } }() + || {try{ info.ProductionCompanies.any{it =~ /.?TVE|ESDIP|Canal Sur|Canal\+|Telecinco/} }catch(e){false}}() + ) { //latina = false (redundant) if (numPaises == 0) notSure = true } else { @@ -100,41 +101,21 @@ if (!tipoYaSeteado && llenguaOriginal=="es" && !soloLangIngles) { latina = numPaisesLat>0 //double check fake latin if (latina) { - def isActuallySpanish = certifications.size()==1 && certifications.ES!=null + def isActuallySpanish = + (certifications.size()==1 && certifications.ES!=null) + || {try{ movie.alternativeTitles.size()==1 && movie.alternativeTitles.containsKey("ES") }catch(e){false}}() if (isActuallySpanish) latina = false } } if (!latina) espanyola = true - - // española *** - /*if (!tipoYaSeteado && (numPaises>0 ? prodCountries.contains("ES") : true)) { - espanyola = - (numPaises==1 || (numPaises==2 && prodCountries.contains("ES") && prodCountries.any{ it=~/AR|PT/ })) - || { try { info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b|\bAntena 3\b/ } catch (e) { false } }() - || ({ try { info.ProductionCompanies.any{it =~ /.?TVE|ESDIP|Canal Sur|Canal\+|Telecinco/}}catch(e){false}}() && llengu.contains("spa") && (llengu.size()==1?llengu[0]=="spa":true)) - || (certifications.size()==1 && certifications.ES!=null) - || ((llengu.size()==1 && llengu[0]=="spa") || (llengu.size()==2 && llengu.contains("spa"))) - || {try{ movie.alternativeTitles.size()==1 && movie.alternativeTitles.ES!=null} catch(e){false}}() - || (pais=~/ES|esp/ && (!llengu.isEmpty() ? llengu.size()==1 && llengu[0]=="spa" : true)) - } - if (!espanyola) latina = true*/ - tipoYaSeteado = tipoYaSeteado || espanyola || latina } //asiaticas def asiatica = false if (!tipoYaSeteado && !soloLangIngles) { - //nn def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"] def paisesIntersec=0 - def languajAsia = ["zh", "cn", "ko", "th", "vi", "ja", "id", "hi", "tl"] - //nn def machingLanguages = languajAsia.intersect(llengu).size() + def languajAsia = ["zh", "cn", "ko", "th", "vi", "ja", "id", "hi", "tl", "bo"] asiatica = languajAsia.contains(llenguaOriginal) - //|| paisesAsiaticos.any{ pais==it } //dona falsos positius - //nn || (numPaises != 0 && {((paisesIntersec=paisesAsiaticos.intersect(prodCountries).size()) == numPaises || (/*en observacion*/paisesIntersec!=0 && !llengu.contains('eng')) ) }()) - //nn || (languajAsia.any{audioLlengu.contains(it)} && prodCountries.any{paisesAsiaticos.contains(it)} && llengu.any{languajAsia.contains(it)} ) - //nn || {try {director.contains("Takeshi Kitano")} catch (e) {false}}() - //|| (machingLanguages > 0 && primaryTitle!=null && localize.English.n!=primaryTitle) // titols en francès diu que es asiatica - //*nn: No Necessari (ja que amb l'idioma original crec que ja esta) tipoYaSeteado = tipoYaSeteado || asiatica } diff --git a/common/functions.groovy b/common/functions.groovy index 62142e0..7937411 100755 --- a/common/functions.groovy +++ b/common/functions.groovy @@ -85,6 +85,6 @@ def sanityCheck(newId) { return oldId!=null ? oldId == newId.toString() : true } def normalitzarText(txt) { - return txt.replaceAll(':','.').replaceAll('\\?','¿').replaceAll('\\"','-') + return txt.replaceAll(':','.').replaceAll('\\?','¿').replaceAll(/\"|>|\*|'/,'-') } /***********/ diff --git a/common/video.groovy b/common/video.groovy index a67d3ba..2b26e2a 100755 --- a/common/video.groovy +++ b/common/video.groovy @@ -19,24 +19,32 @@ : "microHD" : vf def fuente = {try{ source } catch(err){null}}() - if (fuente!=null) calidad = calidad.startsWith("micro") ? calidad : vf + if (fuente!=null) { + calidad = calidad.startsWith("micro") ? calidad : vf + if (fuente.contains("WEB-DL")) fuente = "WEB-DL" + } /***************************/ /** Formato distribución **/ - formato_distribucion = fuente!=null ? fuente : relocation ? '' : + + def formato_distribucion = fuente!=null ? fuente : relocation ? '' : fn=~/(?i)\bblu.?ray\b|\bbdrip\b/ ? (calidad=~/(?i).+rip/ ? '' : 'BDRip') : fn=~/(?i)remux/ ? (calidad=~/(?i).+remux/ ? '' : 'BDRemux') : - fn=~/(?i)\bWEB.??(DL|RIP)\b/ ? 'WEB-DL' : + fn=~/(?i)\bWEB.?(DL|RIP)\b/ ? 'WEB-DL' : '' + if (formato_distribucion=='WEB-DL') { def plataforma = fn.find( //coge el contenido que encaja - /(?i)\bAMZN?\b|\bNF\b|\bHBO\b|\bHBO.?MAX\b|\bHMAX\b|\bHULU\b|\bA3P\b|\bDPLY\b|\bSTARZ\b|\bFILMIN\b|\bFLMN\b|\bNETFLIX\b|\bDSN.?\b|\bDSP+?\b|\bRTVE\b|\bFLIXOL.\b|\bM\+\b/ ) - if (plataforma!=null) plataforma = plataforma.replace("MVPLUS","MV+") - formato_distribucion = formato_distribucion+(plataforma!=null?(' '+plataforma.toUpperCase()):'') + /(?i)\bAMZN?\b|\bNF\b|\bHBO\b|\bHBO.?MAX\b|\bHMAX\b|\bHULU\b|\bA3P\b|\bDPLY\b|\bSTARZ\b|\bFILMIN\b|\bFLMN\b|\bNETFLIX\b|\bDSN.?\b|\bDSP+?\b|\bRTVE\b|\bFLIXOL.\b|(?2000) ruta += "sXXI/" - else ruta += "sXX/" -} else if (latina) ruta = ruta_latina + "main/" -else if (asiatica) ruta = ruta_asiaticas + "main/" -else if (esFamiliar && y>1960) ruta = ruta_familiar + "main/" + else ruta += "sXX/"*/ +} else if (latina) ruta = ruta_latina + "new/" +else if (asiatica) ruta = ruta_asiaticas + "new/" +else if (esFamiliar && y>1960) ruta = ruta_familiar + "new/" else if (y<1980) { - ruta = ruta_classic - if (y>1970) ruta += "70s/" - else ruta += "old/" + ruta = ruta_classic + "new/" + /*if (y>1970) ruta += "70s/" + else ruta += "old/"*/ } else if (y<2000) { - ruta = ruta_retro - if (y>=1990) ruta += "90s/" - else ruta += "80s/" + ruta = ruta_retro + "new/" + /*if (y>=1990) ruta += "90s/" + else ruta += "80s/"*/ } if (ruta==ruta2000) { - if (y>=2021) ruta = ruta_estrenos + "20s/" - else if (y>=2010) ruta += "2010-2020/" - else ruta += "2000-2010/" + if (y>=2021) ruta = ruta_estrenos + "new/"// + "20s/" + else ruta += "new/" + /*else if (y>=2010) ruta += "2010-2020/" + else ruta += "2000-2010/"*/ } /********************************************/ diff --git a/series/folder_file.groovy b/series/folder_file.groovy index 846c45f..a8ef3b5 100755 --- a/series/folder_file.groovy +++ b/series/folder_file.groovy @@ -36,7 +36,7 @@ def temporada = episode.special ? /****************************/ /**** Nombre de fichero *****/ def nombreSerie = normalitzarText({try { catalana ? localize.Catalan.ny : localize.Spanish.ny } catch (err) {localize.Spanish.ny} }()) -def tituloCapitulo = {try { catalana ? localize.Catalan.t : localize.Spanish.t } catch (err) {localize.Spanish.t} }() +def tituloCapitulo = normalitzarText({try { catalana ? localize.Catalan.t : localize.Spanish.t } catch (err) {localize.Spanish.t} }()) def nombreArchivo = nombreSerie+' - '+s00e00+' - '+tituloCapitulo diff --git a/series/root_folders.groovy b/series/root_folders.groovy index cf3df43..7d1a259 100755 --- a/series/root_folders.groovy +++ b/series/root_folders.groovy @@ -1,16 +1,17 @@ def root = '/series/' -def rutaSeries = root+'Series/' + +def rutaSeries = root+ 'Series/' def rutaNSeries = root+'NSeries/' -def ruta_docu = root+'Series_docu/' -def ruta_animacion = root+'Series_animacion/' -def ruta_anime = root+'Series_anime/' -def ruta_antiguas = root+'Series_antiguas/' -def ruta_esp = root+'Series_esp' -def ruta_cat = root+'Series_cat' -def ruta_latina = root+'Series_lat' -def ruta_teen = root+'Series_familiar' -def ruta_infantil = root+'Series_infantil' -def ruta_programastv = root+'programas_tv' +def ruta_docu = root+'Series_docu/new/' +def ruta_animacion = root+'Series_animacion/new/' +def ruta_anime = root+'Series_anime/new/' +def ruta_antiguas = root+'Series_antiguas/new/' +def ruta_esp = root+'Series_esp/new/' +def ruta_cat = root+'Series_cat/new/' +def ruta_latina = root+'Series_lat/new/' +def ruta_teen = root+'Series_familiar/new/' +def ruta_infantil = root+'Series_infantil/new/' +def ruta_programastv = root+'programas_tv/new/' def rutaKO = root+'error/' def ruta = rutaNSeries @@ -18,7 +19,13 @@ def ruta = rutaNSeries try { def tvdb = series.getExternalId('TheTVDB') if (tvdb==null) throw new Exception("[no_id]") - - if (f.toString().contains("/"+rutaSeries)) { + + if (f.toString().contains('/Series/')) { ruta = rutaSeries + } + + def freshFile = ct >= '2022-03-18' + + if (freshFile) { + ruta = ruta.replace('/Series/','/freshOldSeries/') } \ No newline at end of file