bona repassada
This commit is contained in:
parent
68997fc469
commit
9d60356ee5
|
@ -23,10 +23,6 @@ def rutaKO = root+"error/"
|
||||||
def skipAudioCheck = true
|
def skipAudioCheck = true
|
||||||
/*************/
|
/*************/
|
||||||
|
|
||||||
/* Excepciones */
|
|
||||||
|
|
||||||
/***************/
|
|
||||||
|
|
||||||
/** Audio (definición) **/
|
/** Audio (definición) **/
|
||||||
def hayEAC3=false
|
def hayEAC3=false
|
||||||
|
|
||||||
|
@ -90,48 +86,6 @@ def printAudio (audio2Print) {
|
||||||
}
|
}
|
||||||
/***********/
|
/***********/
|
||||||
/* otras funciones */
|
/* otras funciones */
|
||||||
def tieneGeneroAnimacion (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Anima[c|t]i\p{L}n/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroFamilia (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Familia|Family/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroDocumental (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Documental|Documentary/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroReality (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Reality/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def esDocumental (generos, title) {
|
|
||||||
def noJackass = !(title =~ /Jackass/)
|
|
||||||
return (tieneGeneroDocumental(generos) || tieneGeneroReality(generos)) && noJackass
|
|
||||||
}
|
|
||||||
def fromEspPlatform () {
|
|
||||||
def platformES = false
|
|
||||||
try { platformES =
|
|
||||||
info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b/ } catch (ex) {}
|
|
||||||
def companyEs = false
|
|
||||||
try { companyEs =
|
|
||||||
info.ProductionCompanies =~ /.?TVE|ESDIP/ } catch (ex) {}
|
|
||||||
return platformES || companyEs
|
|
||||||
}
|
|
||||||
/**/
|
|
||||||
def getInicial () {
|
def getInicial () {
|
||||||
def nomIngles = localize.English.n
|
def nomIngles = localize.English.n
|
||||||
if (nomIngles.startsWith("The ") || nomIngles.startsWith("A "))
|
if (nomIngles.startsWith("The ") || nomIngles.startsWith("A "))
|
||||||
|
@ -141,19 +95,13 @@ def getInicial () {
|
||||||
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
||||||
return inicial
|
return inicial
|
||||||
}
|
}
|
||||||
|
/***********/
|
||||||
|
|
||||||
try { //empieza el script
|
try { //empieza el script
|
||||||
|
|
||||||
/** Tipo de archivo incorrecto **/
|
/** Tipo de archivo incorrecto **/
|
||||||
def esFicheroMetadatos = false
|
if (ext==~/jpg|nfo|png|url/) {
|
||||||
def tipoMetadato
|
return fn
|
||||||
def nombreWbloqueMediainfo
|
|
||||||
if (ext=="jpg" || ext=="nfo" || ext=="png") {
|
|
||||||
esFicheroMetadatos = true
|
|
||||||
tipoMetadato = fn.find( //coge el contenido que encaja
|
|
||||||
/(?=\-[^-]+$)(.*)(?<!\}|\])$/ )
|
|
||||||
if(tipoMetadato==null)tipoMetadato=''
|
|
||||||
}
|
}
|
||||||
else if (ext!="mkv" && ext!="avi" && ext!="mp4") {
|
else if (ext!="mkv" && ext!="avi" && ext!="mp4") {
|
||||||
throw new Exception("[formato_fichero_noestarndar]")
|
throw new Exception("[formato_fichero_noestarndar]")
|
||||||
|
@ -163,6 +111,11 @@ try { //empieza el script
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Exception("[video_roto]")
|
throw new Exception("[video_roto]")
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
genres
|
||||||
|
} catch (err) {
|
||||||
|
throw new Exception("[genero_no_especificado]")
|
||||||
|
}
|
||||||
/********************************/
|
/********************************/
|
||||||
|
|
||||||
/** Codec Vídeo: en nombre fichero **/
|
/** Codec Vídeo: en nombre fichero **/
|
||||||
|
@ -170,7 +123,7 @@ try { //empieza el script
|
||||||
(any{vc}{0} =~ /264/) ? 'AVC' : vc
|
(any{vc}{0} =~ /264/) ? 'AVC' : vc
|
||||||
/**************/
|
/**************/
|
||||||
|
|
||||||
/******* Calidad: División en carpetas y definición nombre fichero ******/
|
/******* Calidad ******/
|
||||||
def peso = bytes.toString().before(' ').toDouble()
|
def peso = bytes.toString().before(' ').toDouble()
|
||||||
def numericBps = (mbps.toString().before(' ').toDouble()*1000000).round()
|
def numericBps = (mbps.toString().before(' ').toDouble()*1000000).round()
|
||||||
def calidad =
|
def calidad =
|
||||||
|
@ -261,183 +214,168 @@ try { //empieza el script
|
||||||
if (bloqueAudio==null) bloqueAudio = "audio_no_def"
|
if (bloqueAudio==null) bloqueAudio = "audio_no_def"
|
||||||
/***********/
|
/***********/
|
||||||
|
|
||||||
//todo lo demás solo interesa para el fichero que contiene la pelicula
|
/** Formato distribución **/
|
||||||
//if (esFicheroMetadatos==false) {
|
formato_distribucion =
|
||||||
|
fn=~/(?i)\bblu.?ray\b/ ? 'BDRip' :
|
||||||
|
fn=~/(?i)\bdrip\b/ ? 'BDRip' :
|
||||||
|
fn=~/(?i)\bDVD.?RIP\b/ ? 'DVDRip' :
|
||||||
|
fn=~/(?i)\bHDiTunes\b/ ? 'HDiTunes' :
|
||||||
|
fn=~/(?i)\bTV.?RIP\b/ ? 'TVRip' :
|
||||||
|
fn=~/(?i)\bWEB.?Screener\b/ ? 'WEB-SRC' :
|
||||||
|
'no_encontrado'
|
||||||
|
def plataforma
|
||||||
|
def esWEB_DL=false
|
||||||
|
if (formato_distribucion=='no_encontrado') {
|
||||||
|
esWEB_DL = fn=~/(?i)\bWEB.??(DL|RIP)\b/ //WEB-DL o WEB-RIP (todo junto o con punto/guión/etc)
|
||||||
|
|
||||||
/** Formato distribución **/
|
if (esWEB_DL) {
|
||||||
formato_distribucion =
|
def web_x = fn=~/(?i)\bWEB.?DL\b/ ? 'WEB-DL' : 'WEB-RIP' //guardar el que es
|
||||||
fn=~/(?i)\bblu.?ray\b/ ? 'BDRip' :
|
plataforma = fn.find( //coge el contenido que encaja
|
||||||
fn=~/(?i)\bdrip\b/ ? 'BDRip' :
|
/(?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/ )
|
||||||
fn=~/(?i)\bDVD.?RIP\b/ ? 'DVDRip' :
|
if (plataforma!=null) plataforma = plataforma.replace("MVPLUS","MV+")
|
||||||
fn=~/(?i)\bHDiTunes\b/ ? 'HDiTunes' :
|
formato_distribucion = web_x+(plataforma!=null?(' '+plataforma.toUpperCase()):'') //web-dl/rip + plataforma(si hay)
|
||||||
fn=~/(?i)\bTV.?RIP\b/ ? 'TVRip' :
|
|
||||||
fn=~/(?i)\bWEB.?Screener\b/ ? 'WEB-SRC' :
|
|
||||||
'no_encontrado'
|
|
||||||
def plataforma
|
|
||||||
def esWEB_DL=false
|
|
||||||
if (formato_distribucion=='no_encontrado') {
|
|
||||||
esWEB_DL = fn=~/(?i)\bWEB.??(DL|RIP)\b/ //WEB-DL o WEB-RIP (todo junto o con punto/guión/etc)
|
|
||||||
|
|
||||||
if (esWEB_DL) {
|
|
||||||
def web_x = fn=~/(?i)\bWEB.?DL\b/ ? 'WEB-DL' : 'WEB-RIP' //guardar el que es
|
|
||||||
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 = web_x+(plataforma!=null?(' '+plataforma.toUpperCase()):'') //web-dl/rip + plataforma(si hay)
|
|
||||||
} else {
|
|
||||||
if (hayEAC3) //por el audio también se determina que es web-dl
|
|
||||||
formato_distribucion = 'WEB-DL'
|
|
||||||
else {
|
|
||||||
def otrosFD = fn.find( /(?i)\bMTL\b |\bMUBI\b/ )
|
|
||||||
if (otrosFD!= null && !otrosFD.isEmpty())
|
|
||||||
formato_distribucion = otrosFD.toUpperCase() //si son estos, se setea
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**********/
|
|
||||||
|
|
||||||
/** Formato distribución 2ª ronda**/
|
|
||||||
//formato_distribucion = formato_distribucion=='no_encontrado'? '' : ' '+formato_distribucion
|
|
||||||
if (formato_distribucion=='no_encontrado') {
|
|
||||||
formato_distribucion =
|
|
||||||
calidad=="4K-UHDRemux" ? "UHDRemux" :
|
|
||||||
calidad=="4K-UHDRip" ? "UHDRip" :
|
|
||||||
calidad=="4K-MicroUHD" ? "UHDRip" :
|
|
||||||
calidad=="1080-BDRemux" ? "BDRemux" :
|
|
||||||
calidad=="1080-HD" ? "DBRip" :
|
|
||||||
calidad=="1080-MicroHD" ? "BDRip" :
|
|
||||||
'' //no_encontrado -> ''
|
|
||||||
} else {
|
} else {
|
||||||
if (calidad=~/(?i)\remux\b/) {
|
if (hayEAC3) //por el audio también se determina que es web-dl
|
||||||
formato_distribucion =
|
formato_distribucion = 'WEB-DL'
|
||||||
calidad=="4K-UHDRemux" ? "UHDRemux" :
|
else {
|
||||||
calidad=="1080-BDRemux" ? "BDRemux" :
|
def otrosFD = fn.find( /(?i)\bMTL\b |\bMUBI\b/ )
|
||||||
'' //no_encontrado -> ''
|
if (otrosFD!= null && !otrosFD.isEmpty())
|
||||||
}
|
formato_distribucion = otrosFD.toUpperCase() //si son estos, se setea
|
||||||
|
|
||||||
}
|
|
||||||
if (formato_distribucion!='') formato_distribucion=' '+formato_distribucion
|
|
||||||
/**********************************/
|
|
||||||
|
|
||||||
/**** Nombre pelicula ****/
|
|
||||||
def nombrePelicula_formatoPlex
|
|
||||||
def tieneQueUsarSpa=true
|
|
||||||
if (tenimCat) {
|
|
||||||
try {
|
|
||||||
if (primaryTitle!=localize.Catalan.n) {
|
|
||||||
tieneQueUsarSpa = false
|
|
||||||
nombrePelicula_formatoPlex = localize.Catalan.plex.name
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
tieneQueUsarSpa=true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tieneQueUsarSpa)
|
}
|
||||||
nombrePelicula_formatoPlex = localize.Spanish.plex.name
|
/**********/
|
||||||
/*************************/
|
|
||||||
|
|
||||||
/**** HDR ********/
|
/** Formato distribución 2ª ronda**/
|
||||||
def hdr_info=''
|
//formato_distribucion = formato_distribucion=='no_encontrado'? '' : ' '+formato_distribucion
|
||||||
try{
|
if (formato_distribucion=='no_encontrado') {
|
||||||
def mHDRCol = ["BT.709" : "NO", "BT.2020" : "YES"]
|
formato_distribucion =
|
||||||
def hdr_info_old = (bitdepth >= 10 && mHDRCol.get(self.video[0].colourprimaries) == "YES" ) ? ' HDR' : ''
|
calidad=="4K-UHDRemux" ? "UHDRemux" :
|
||||||
|
calidad=="4K-UHDRip" ? "UHDRip" :
|
||||||
|
calidad=="4K-MicroUHD" ? "UHDRip" :
|
||||||
|
calidad=="1080-BDRemux" ? "BDRemux" :
|
||||||
|
calidad=="1080-HD" ? "DBRip" :
|
||||||
|
calidad=="1080-MicroHD" ? "BDRip" :
|
||||||
|
'' //no_encontrado -> ''
|
||||||
|
} else {
|
||||||
|
if (calidad=~/(?i)\remux\b/) {
|
||||||
|
formato_distribucion =
|
||||||
|
calidad=="4K-UHDRemux" ? "UHDRemux" :
|
||||||
|
calidad=="1080-BDRemux" ? "BDRemux" :
|
||||||
|
'' //no_encontrado -> ''
|
||||||
|
}
|
||||||
|
|
||||||
def _HDRMap = [
|
}
|
||||||
"HDR10": "HDR10",
|
if (formato_distribucion!='') formato_distribucion=' '+formato_distribucion
|
||||||
"SMPTE ST 2086": "HDR10",
|
/**********************************/
|
||||||
"SMPTE ST 2094 App 4": "HDR10+",
|
|
||||||
"Dolby Vision / SMPTE ST 2086": "Dolby Vision",
|
/**** HDR ********/
|
||||||
"Dolby Vision / HDR10": "Dolby Vision",
|
def hdr_info=''
|
||||||
]
|
try{
|
||||||
def vid = video.first()
|
def mHDRCol = ["BT.709" : "NO", "BT.2020" : "YES"]
|
||||||
String _HDR
|
def hdr_info_old = (bitdepth >= 10 && mHDRCol.get(self.video[0].colourprimaries) == "YES" ) ? ' HDR' : ''
|
||||||
switch (bitdepth) {
|
|
||||||
case { it > 8 }:
|
def _HDRMap = [
|
||||||
_HDR = any
|
"HDR10": "HDR10",
|
||||||
{ vid["HDR_Format_Commercial"] }
|
"SMPTE ST 2086": "HDR10",
|
||||||
{ vid["HDR_Format"] }
|
"SMPTE ST 2094 App 4": "HDR10+",
|
||||||
{ hdr }
|
"Dolby Vision / SMPTE ST 2086": "Dolby Vision",
|
||||||
{ null }
|
"Dolby Vision / HDR10": "Dolby Vision",
|
||||||
break
|
]
|
||||||
default:
|
def vid = video.first()
|
||||||
"$bitdepth-bit"
|
String _HDR
|
||||||
|
switch (bitdepth) {
|
||||||
|
case { it > 8 }:
|
||||||
|
_HDR = any
|
||||||
|
{ vid["HDR_Format_Commercial"] }
|
||||||
|
{ vid["HDR_Format"] }
|
||||||
|
{ hdr }
|
||||||
|
{ null }
|
||||||
break
|
break
|
||||||
}
|
default:
|
||||||
def hdr_info_ = _HDRMap.find { k, v ->
|
"$bitdepth-bit"
|
||||||
k =~ _HDR
|
break
|
||||||
}?.value
|
}
|
||||||
|
def hdr_info_ = _HDRMap.find { k, v ->
|
||||||
|
k =~ _HDR
|
||||||
|
}?.value
|
||||||
|
|
||||||
if (hdr_info_!=null) hdr_info=' '+hdr_info_
|
if (hdr_info_!=null) hdr_info=' '+hdr_info_
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
/*****************/
|
/*****************/
|
||||||
|
|
||||||
/**** Profundidad de color */
|
/**** Profundidad de color */
|
||||||
def profundidadColor=''
|
def profundidadColor=''
|
||||||
try{profundidadColor = bitdepth+"bits" } catch(err){}
|
try{profundidadColor = bitdepth+"bits" } catch(err){}
|
||||||
/**************************/
|
/**************************/
|
||||||
|
|
||||||
/**** Profundidad vídeo ****/
|
/**** Profundidad vídeo ****/
|
||||||
def myBitrate = 'noBRdef'
|
def myBitrate = 'noBRdef'
|
||||||
try{ myBitrate = mbps.replace(/.0/,'').replace(' ','') }catch(err){}
|
try{ myBitrate = mbps.replace(/.0/,'').replace(' ','') }catch(err){}
|
||||||
def myFps = ' FRvar'
|
def myFps = ' FRvar'
|
||||||
try { myFps = ' '+fps.replace(/.0/,'').replace(' ','') }catch(err){}
|
try { myFps = ' '+fps.replace(/.0/,'').replace(' ','') }catch(err){}
|
||||||
/***************************/
|
/***************************/
|
||||||
|
|
||||||
|
/* RESULTADO MEDIAINFO */
|
||||||
|
def bloqueCalidadVideo = calidadF+formato_distribucion+hdr_info
|
||||||
|
def bloqueProfundidad = myBitrate+myFps
|
||||||
|
if (bloqueProfundidad!='' && profundidadColor!='') bloqueProfundidad=' '+bloqueProfundidad
|
||||||
|
|
||||||
|
def bloqueMediainfo = ' ['+codecVideo+' '+bloqueCalidadVideo+']['+profundidadColor+bloqueProfundidad+']'+' ['+bloqueAudio+']'
|
||||||
|
|
||||||
/* RESULTADO MEDIAINFO */
|
|
||||||
def bloqueCalidadVideo = calidadF+formato_distribucion+hdr_info
|
|
||||||
def bloqueProfundidad = myBitrate+myFps
|
|
||||||
if (bloqueProfundidad!='' && profundidadColor!='') bloqueProfundidad=' '+bloqueProfundidad
|
|
||||||
|
|
||||||
nombreWbloqueMediainfo = nombrePelicula_formatoPlex +' ['+codecVideo+' '+bloqueCalidadVideo+']['+profundidadColor+bloqueProfundidad+']'+' ['+bloqueAudio+']'
|
|
||||||
//+' {imdb-'+imdbid+'}'
|
|
||||||
//}
|
|
||||||
|
|
||||||
/**************************************/
|
/**************************************/
|
||||||
/**** Carpeta / tipo contenido *******/
|
/**** Carpeta / tipo contenido *******/
|
||||||
def generes
|
def tipoYaSeteado=false
|
||||||
def errorNoGenero=false
|
|
||||||
try {generes=genres} catch (err) {errorNoGenero=true}
|
|
||||||
def numPaises = info.ProductionCountries.size()
|
|
||||||
|
|
||||||
def tieneAnimacion = tieneGeneroAnimacion(generes)
|
//animacion (no concluyente)
|
||||||
def tieneFamiliar = tieneGeneroFamilia(generes)
|
def tieneAnimacion = genres.any{ it =~ /Anima.i.n/}
|
||||||
|
//familiar (no conclud)
|
||||||
def esDocu = esDocumental(generes, localize.English.n)
|
def tieneFamiliar = genres.any{ it =~ /Familia|Family/}
|
||||||
|
//docu
|
||||||
|
def esDocu = genres.any{ it =~ /Documental|Documentary|Reality/} && !(title =~ /Jackass/)
|
||||||
|
//anime
|
||||||
def esAnime = false
|
def esAnime = false
|
||||||
|
def numPaises = info.ProductionCountries.size()
|
||||||
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
||||||
esAnime = numPaises==1 || anime
|
esAnime = numPaises==1 || anime /*|| country=="JP"*/
|
||||||
}
|
}
|
||||||
|
tipoYaSeteado = esDocu || esAnime
|
||||||
|
|
||||||
//*** española ***
|
//*** española ***
|
||||||
def hispanico = info.ProductionCountries.contains("ES") && (numPaises==1 || (numPaises==2 && info.ProductionCountries.contains("PT")))
|
def espanyola = false
|
||||||
def espanyola = hispanico || fromEspPlatform() || (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
if (!tipoYaSeteado && info.ProductionCountries.contains("ES")) {
|
||||||
//|| ({ try { languages.size()==1 && languages.get(0)=="esp" } catch (Exception e) { null } })()
|
espanyola=
|
||||||
|
(numPaises==1 || (numPaises==2 && info.ProductionCountries.contains("PT")))
|
||||||
|
|| { try { info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b/ } catch (e) { false } }()
|
||||||
|
|| { try { info.ProductionCompanies.any{ it =~ /.?TVE|ESDIP|Canal Sur|Canal\+ España/ } } catch (e) { false } }()
|
||||||
|
|| (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
||||||
|
|| { try { languages.size()==1 && languages.get(0).toString()=~/esp|spa/ } catch (e) { false } }()
|
||||||
|
|| (movie.alternativeTitles.size()==1 && movie.alternativeTitles.ES!=null)
|
||||||
|
|| { try { country=="ES" } catch (e){false} }() && { try { if(languages.size()==1) languages.get(0).toString()!="eng" } catch (e) { false } }()
|
||||||
|
tipoYaSeteado = espanyola
|
||||||
|
}
|
||||||
|
|
||||||
//***** familiar vs infantil ****
|
//***** familiar vs infantil ****
|
||||||
def esFamiliar = tieneFamiliar
|
def esFamiliar = tieneFamiliar
|
||||||
def infantil = false
|
def infantil = false
|
||||||
|
|
||||||
def tipoYaSeteado=esDocu || esAnime
|
|
||||||
if (!tipoYaSeteado) {
|
if (!tipoYaSeteado) {
|
||||||
|
|
||||||
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
||||||
|
|
||||||
if (tieneFamiliar && tieneAnimacion) {
|
if (tieneFamiliar && tieneAnimacion) {
|
||||||
def noTanInfantil = info.Certifications.US ==~/PG-13/
|
def noTanInfantil = info.Certifications.US ==~/PG-13/
|
||||||
if (!noTanInfantil)
|
if (!noTanInfantil) infantil = true
|
||||||
infantil = true
|
|
||||||
}
|
}
|
||||||
else if (tieneAnimacion) {
|
else if (tieneAnimacion) {
|
||||||
if (tieneCertificacion) {
|
if (tieneCertificacion) {
|
||||||
if ( info.Certifications.US=="G"
|
infantil = info.Certifications.US=="G"
|
||||||
|| info.Certifications.ES==~/Ai|APTA/
|
|| info.Certifications.ES==~/Ai|APTA/
|
||||||
|| info.Certifications.DE==~/0|6/
|
|| info.Certifications.DE==~/0|6/
|
||||||
|| info.Certifications.IT=="T"
|
|| info.Certifications.IT=="T"
|
||||||
|| info.Certifications.LT=="V" || info.Certifications.RU ==~ /6.+/
|
|| info.Certifications.LT=="V" || info.Certifications.RU ==~ /6.+/
|
||||||
|| info.Certifications.BR=="L"
|
|| info.Certifications.BR=="L"
|
||||||
)
|
|
||||||
infantil=true
|
|
||||||
} else {
|
} else {
|
||||||
def titulosInfantiles = ['Bonnie bears', 'The Jungle Bunch']
|
def titulosInfantiles = ['Bonnie bears', 'The Jungle Bunch']
|
||||||
if (titulosInfantiles.any { localize.English.n.toLowerCase()contains(it.toLowerCase()) })
|
if (titulosInfantiles.any { localize.English.n.toLowerCase()contains(it.toLowerCase()) })
|
||||||
|
@ -450,25 +388,26 @@ try { //empieza el script
|
||||||
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tipoYaSeteado = esFamiliar || infantil
|
||||||
}
|
}
|
||||||
|
|
||||||
//asiaticas
|
//asiaticas
|
||||||
def asiatica = false
|
def asiatica = false
|
||||||
tipoYaSeteado = tipoYaSeteado & (infantil || espanyola)
|
|
||||||
if (!tipoYaSeteado) {
|
if (!tipoYaSeteado) {
|
||||||
//asiaticas
|
//asiaticas
|
||||||
if (numPaises>0) {
|
if (numPaises>0) {
|
||||||
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
||||||
|
def languajAsia = ["zho", "kor", "thai", "vie", "jpn", "ind"]
|
||||||
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
||||||
def allAsian = matchP.size()==numPaises
|
asiatica = matchP.size() == numPaises
|
||||||
def probableAsian = matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1
|
|| {try { languages.any{ languajAsia.contains(it.toString()) } } catch (err) {false} }()
|
||||||
if (allAsian || probableAsian/*en obseracion*/) asiatica=true
|
//|| matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1 /*en obseracion*/
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//es animacion
|
//es animacion
|
||||||
def esAnimacion = tieneAnimacion && !esFamiliar && !espanyola && !asiatica
|
def esAnimacion = tieneAnimacion && !esFamiliar
|
||||||
|
|
||||||
|
|
||||||
//tria
|
//tria
|
||||||
if (esDocu) ruta = ruta_docu
|
if (esDocu) ruta = ruta_docu
|
||||||
|
@ -484,33 +423,29 @@ try { //empieza el script
|
||||||
/********************************************/
|
/********************************************/
|
||||||
/**************************************/
|
/**************************************/
|
||||||
|
|
||||||
//if (errorNoGenero && ruta!=ruta_classic && ruta!=ruta_retro && !espanyola && !semiEsp && !infantil && ruta!=ruta_estrenos )
|
|
||||||
// throw new Exception("[genero_no_especificado]")
|
/**** Nombre pelicula ****/
|
||||||
|
def nombrePelicula_formatoPlex = {try { primaryTitle!=localize.Catalan.n ? localize.Catalan.plex.name : localize.Spanish.plex.name } catch (err) {localize.Spanish.plex.name} }()
|
||||||
|
/*************************/
|
||||||
|
|
||||||
|
|
||||||
/*** RESULTADO FINAL ***/
|
/*** RESULTADO FINAL ***/
|
||||||
def inicial=''
|
def inicial = (ruta==rutaOK || ruta==ruta_retro) ? getInicial() : ''
|
||||||
|
|
||||||
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro
|
|
||||||
if (inicialsRequerides) {
|
|
||||||
inicial = getInicial()
|
|
||||||
}
|
|
||||||
def tmdb = " {tmdb-"+tmdbid+"}"
|
def tmdb = " {tmdb-"+tmdbid+"}"
|
||||||
def nomPrincipal = esFicheroMetadatos ? nombreWbloqueMediainfo+tipoMetadato : nombreWbloqueMediainfo
|
def carpetaPeli = localize.Spanish.plex.name + tmdb + '/'
|
||||||
|
def nomPrincipal = nombrePelicula_formatoPlex + bloqueMediainfo
|
||||||
def tracker = fn.find(/(?i)\bHDO(limpo)?\b/)
|
def tracker = fn.find(/(?i)\bHDO(limpo)?\b/)
|
||||||
def extras = tracker != null ? ' ['+tracker.replace("HDOlimpo", "HDO")+']' : ''
|
def extras = tracker != null ? ' ['+tracker.replace("HDOlimpo", "HDO")+']' : ''
|
||||||
def resultado = ruta + //directorios
|
|
||||||
//nombre fichero
|
|
||||||
inicial +
|
|
||||||
localize.English.plex.name + '/' + nomPrincipal + extras + tmdb
|
|
||||||
//(esFicheroMetadatos ? localize.Spanish.plex.name+tipoMetadato : nombreWbloqueMediainfo)
|
|
||||||
|
|
||||||
return resultado
|
return ruta + inicial + carpetaPeli + nomPrincipal + extras + tmdb
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
||||||
String str= err.getStackTrace().toString()
|
if (ubuntu_desktop) {
|
||||||
def pattern = ( str =~ /groovy.(\d+)./ )
|
String str= err.getStackTrace().toString()
|
||||||
return " Error at line number = " + pattern[0][1] + ". more: "+str
|
def pattern = ( str =~ /groovy.(\d+)./ )
|
||||||
|
return " Error at line number = " + pattern[0][1] + ". more: "+str
|
||||||
|
}
|
||||||
|
|
||||||
def rutaMotivoErr
|
def rutaMotivoErr
|
||||||
def msgErr = err.getMessage()
|
def msgErr = err.getMessage()
|
||||||
|
|
|
@ -21,44 +21,8 @@ def rutaKO = root+"error/"
|
||||||
|
|
||||||
/* HARDCODED */
|
/* HARDCODED */
|
||||||
def skipAudioCheck = true
|
def skipAudioCheck = true
|
||||||
def infantilHardCoded = false
|
|
||||||
|
|
||||||
/* otras funciones */
|
/* otras funciones */
|
||||||
def tieneGeneroAnimacion (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Anima[c|t]i\p{L}n/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroFamilia (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Familia|Family/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroDocumental (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Documental|Documentary/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroReality (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Reality/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def esDocumental (generos, title) {
|
|
||||||
def noJackass = !(title =~ /Jackass/)
|
|
||||||
return (tieneGeneroDocumental(generos) || tieneGeneroReality(generos)) && noJackass
|
|
||||||
}
|
|
||||||
def fromEspPlatform () {
|
|
||||||
return fn.find(/(?i)\bFLIXOL.\b|\bRTVE\b/) != null
|
|
||||||
}
|
|
||||||
/**/
|
/**/
|
||||||
def getInicial () {
|
def getInicial () {
|
||||||
def nomIngles = localize.English.n
|
def nomIngles = localize.English.n
|
||||||
|
@ -91,6 +55,11 @@ try { //empieza el script
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Exception("[video_roto]")
|
throw new Exception("[video_roto]")
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
genres
|
||||||
|
} catch (err) {
|
||||||
|
throw new Exception("[genero_no_especificado]")
|
||||||
|
}
|
||||||
/********************************/
|
/********************************/
|
||||||
|
|
||||||
|
|
||||||
|
@ -150,24 +119,35 @@ try { //empieza el script
|
||||||
|
|
||||||
/**************************************/
|
/**************************************/
|
||||||
/**** Carpeta / tipo contenido *******/
|
/**** Carpeta / tipo contenido *******/
|
||||||
def generes
|
def tipoYaSeteado=false
|
||||||
def errorNoGenero=false
|
|
||||||
try {generes=genres} catch (err) {errorNoGenero=true}
|
|
||||||
|
|
||||||
def tieneAnimacion = tieneGeneroAnimacion(generes)
|
//animacion (no concluyente)
|
||||||
def tieneFamiliar = tieneGeneroFamilia(generes)
|
def tieneAnimacion = genres.any{ it =~ /Anima.i.n/}
|
||||||
|
//familiar (no conclud)
|
||||||
def esDocu = esDocumental(generes, localize.English.n)
|
def tieneFamiliar = genres.any{ it =~ /Familia|Family/}
|
||||||
|
//docu
|
||||||
|
def esDocu = genres.any{ it =~ /Documental|Documentary|Reality/} && !localize.English.n.contains("Jackass")
|
||||||
|
//anime
|
||||||
def esAnime = false
|
def esAnime = false
|
||||||
|
def numPaises = info.ProductionCountries.size()
|
||||||
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
||||||
esAnime = info.ProductionCountries.size()==1 || anime
|
esAnime = numPaises==1 || anime /*|| country=="JP"*/
|
||||||
}
|
}
|
||||||
|
tipoYaSeteado = esDocu || esAnime
|
||||||
|
|
||||||
|
//*** española ***
|
||||||
|
def espanyola = tipoYaSeteado
|
||||||
|
|| info.ProductionCountries.contains("ES") && (numPaises==1 || (numPaises==2 && info.ProductionCountries.contains("PT")))
|
||||||
|
|| { try { info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b/ } catch (e) { false } }()
|
||||||
|
|| { try { info.ProductionCompanies.any{ it =~ /.?TVE|ESDIP|Canal Sur|Canal\+ España/ } } catch (e) { false } }()
|
||||||
|
|| (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
||||||
|
|| { try { languages.size()==1 && languages.get(0).toString()=="esp" } catch (e) { false } }() || (movie.alternativeTitles.size()==1 && movie.alternativeTitles.ES!=null)
|
||||||
|
|| { try { country=="ES" } catch (e){false} }() && { try { if(languages.size()==1) languages.get(0).toString()!="eng" } catch (e) { false } }()
|
||||||
|
tipoYaSeteado = tipoYaSeteado || espanyola
|
||||||
|
|
||||||
//***** familiar vs infantil ****
|
//***** familiar vs infantil ****
|
||||||
def esFamiliar = tieneFamiliar
|
def esFamiliar = tieneFamiliar
|
||||||
def infantil = false
|
def infantil = false
|
||||||
|
|
||||||
def tipoYaSeteado=esDocu || esAnime
|
|
||||||
if (!tipoYaSeteado) {
|
if (!tipoYaSeteado) {
|
||||||
|
|
||||||
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
||||||
|
@ -199,44 +179,39 @@ try { //empieza el script
|
||||||
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tipoYaSeteado = tipoYaSeteado || infantil
|
||||||
}
|
}
|
||||||
|
|
||||||
//espanyoles & asiaticas
|
//asiaticas
|
||||||
def espanyola = false
|
|
||||||
def asiatica = false
|
def asiatica = false
|
||||||
tipoYaSeteado=esDocu || esAnime || esFamiliar || infantil
|
|
||||||
if (!tipoYaSeteado) {
|
if (!tipoYaSeteado) {
|
||||||
|
|
||||||
def segurEsp = info.ProductionCountries.contains("ES") && info.ProductionCountries.size()==1
|
|
||||||
espanyola = fromEspPlatform() || segurEsp
|
|
||||||
|
|
||||||
//asiaticas
|
//asiaticas
|
||||||
if (!espanyola && info.ProductionCountries.size()>0) {
|
if (numPaises>0) {
|
||||||
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
||||||
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
||||||
def allAsian = matchP.size()==info.ProductionCountries.size()
|
def allAsian = matchP.size()==numPaises
|
||||||
def probableAsian = matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1
|
def probableAsian = matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1
|
||||||
if (allAsian || probableAsian/*en obseracion*/) asiatica=true
|
if (allAsian || probableAsian/*en obseracion*/) asiatica=true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//es animacion
|
||||||
|
def esAnimacion = tieneAnimacion && !esFamiliar
|
||||||
|
|
||||||
//tria
|
//tria
|
||||||
if (esDocu) ruta = ruta_docu
|
if (esDocu) ruta = ruta_docu
|
||||||
else if (esAnime) ruta = ruta_anime
|
else if (esAnime) ruta = ruta_anime
|
||||||
else if (infantil) ruta = ruta_infantil
|
else if (infantil) ruta = ruta_infantil
|
||||||
else if (esFamiliar) ruta = ruta_familiar
|
else if (esAnimacion) ruta = ruta_animacion
|
||||||
else if (tieneAnimacion) ruta = ruta_animacion
|
|
||||||
else if (asiatica) ruta = ruta_asiaticas
|
|
||||||
else if (espanyola) ruta = ruta_esp
|
else if (espanyola) ruta = ruta_esp
|
||||||
|
else if (esFamiliar) ruta = ruta_familiar
|
||||||
|
else if (asiatica) ruta = ruta_asiaticas
|
||||||
else if (y<1980) ruta = ruta_classic
|
else if (y<1980) ruta = ruta_classic
|
||||||
else if (y<2000) ruta = ruta_retro
|
else if (y<2000) ruta = ruta_retro
|
||||||
if (ruta==rutaOK && y>=2021) ruta = ruta_estrenos
|
if (ruta==rutaOK && y>=2021) ruta = ruta_estrenos
|
||||||
/********************************************/
|
/********************************************/
|
||||||
/**************************************/
|
/**************************************/
|
||||||
|
|
||||||
//if (errorNoGenero && ruta!=ruta_classic && ruta!=ruta_retro && !espanyola && !semiEsp && !infantil && ruta!=ruta_esp_retro && ruta!=ruta_esp_classic && ruta!=ruta_estrenos )
|
|
||||||
// throw new Exception("[genero_no_especificado]")
|
|
||||||
|
|
||||||
/*** RESULTADO FINAL ***/
|
/*** RESULTADO FINAL ***/
|
||||||
def inicial=''
|
def inicial=''
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue