|
|
@ -1,12 +1,13 @@
|
|
|
|
//by @xeviff
|
|
|
|
//by @xeviff
|
|
|
|
/* HARDCODED */
|
|
|
|
/* HARDCODED */
|
|
|
|
def skipAudioCheck = true
|
|
|
|
def ubuntu_desktop=true
|
|
|
|
def relocation = true
|
|
|
|
def relocation = true
|
|
|
|
|
|
|
|
def skipAudioCheck = true
|
|
|
|
/*************/
|
|
|
|
/*************/
|
|
|
|
/** RUTAS **/
|
|
|
|
/** RUTAS **/
|
|
|
|
def ubuntu_desktop=false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def root = ubuntu_desktop ? '/mnt/mangrana_pelis/' : '/pelis/'
|
|
|
|
|
|
|
|
|
|
|
|
def root = '/pelis/'
|
|
|
|
def rutaOK = root+"Pelis/plain/"
|
|
|
|
def rutaOK = root+"Pelis/plain/"
|
|
|
|
def ruta = rutaOK
|
|
|
|
def ruta = rutaOK
|
|
|
|
def ruta_docu = root+"Documentales/plain/"
|
|
|
|
def ruta_docu = root+"Documentales/plain/"
|
|
|
@ -15,6 +16,7 @@ def ruta_animacion = root+"Pelis_animacion/"
|
|
|
|
def ruta_infantil = root+"Pelis_infantiles/"
|
|
|
|
def ruta_infantil = root+"Pelis_infantiles/"
|
|
|
|
def ruta_familiar = root+"Pelis_familiar/"
|
|
|
|
def ruta_familiar = root+"Pelis_familiar/"
|
|
|
|
def ruta_esp = root+"Pelis_esp/plain/"
|
|
|
|
def ruta_esp = root+"Pelis_esp/plain/"
|
|
|
|
|
|
|
|
def ruta_latina = root+"Pelis_lat/"
|
|
|
|
def ruta_cat = root+"Pelis_cat/"
|
|
|
|
def ruta_cat = root+"Pelis_cat/"
|
|
|
|
def ruta_retro = root+"Pelis_retro/plain/"
|
|
|
|
def ruta_retro = root+"Pelis_retro/plain/"
|
|
|
|
def ruta_estrenos = root+"Pelis_estrenos/plain/"
|
|
|
|
def ruta_estrenos = root+"Pelis_estrenos/plain/"
|
|
|
@ -122,21 +124,16 @@ try { //empieza el script
|
|
|
|
} catch (err) {}
|
|
|
|
} catch (err) {}
|
|
|
|
/*****************/
|
|
|
|
/*****************/
|
|
|
|
|
|
|
|
|
|
|
|
/**** Profundidad de color */
|
|
|
|
|
|
|
|
def profundidadColor=''
|
|
|
|
|
|
|
|
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(' Mbps','M') }catch(err){}
|
|
|
|
def myFps = ' FRvar'
|
|
|
|
def myFps = ' FRvar'
|
|
|
|
try { myFps = ' '+fps.replace(/.0/,'').replace(' ','') }catch(err){}
|
|
|
|
try { myFps = ' '+fps.replace(/.0/,'').replace(' fps','f') }catch(err){}
|
|
|
|
/***************************/
|
|
|
|
/***************************/
|
|
|
|
|
|
|
|
|
|
|
|
/* BLOQUE VIDEO */
|
|
|
|
/* BLOQUE VIDEO */
|
|
|
|
def bloqueCalidadVideo = calidad + formato_distribucion
|
|
|
|
def bloqueCalidadVideo = calidad + formato_distribucion
|
|
|
|
def bloqueDescVideo = myBitrate + profundidadColor + myFps + hdr_info
|
|
|
|
def bloqueDescVideo = myBitrate + myFps + hdr_info
|
|
|
|
def bloqueVideo = ' ['+codecVideo+' '+bloqueCalidadVideo+' '+bloqueDescVideo+']'
|
|
|
|
def bloqueVideo = ' ['+codecVideo+' '+bloqueCalidadVideo+' '+bloqueDescVideo+']'
|
|
|
|
/**********************************************************************************************************/
|
|
|
|
/**********************************************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
@ -145,7 +142,8 @@ try { //empieza el script
|
|
|
|
def audiosMap = [:]
|
|
|
|
def audiosMap = [:]
|
|
|
|
for (aud in audio) {
|
|
|
|
for (aud in audio) {
|
|
|
|
def shortDesc = aud.Language_String3 !=null ? aud.Language_String3
|
|
|
|
def shortDesc = aud.Language_String3 !=null ? aud.Language_String3
|
|
|
|
: (aud.Title=~/(?i).+spa.+/?'spa': aud.Title.substring(0,3).toLowerCase())
|
|
|
|
: aud.Title!=null ? (aud.Title=~/(?i).+spa.+/?'spa': aud.Title.substring(0,3).toLowerCase()) : 'und'
|
|
|
|
|
|
|
|
if (aud.Title!=null && aud.Title=~/(?i).*latin.*/) shortDesc='lat'
|
|
|
|
audiosMap[shortDesc] = audiosMap[shortDesc] ?: [:]
|
|
|
|
audiosMap[shortDesc] = audiosMap[shortDesc] ?: [:]
|
|
|
|
audiosMap[shortDesc][aud.Format] = audiosMap[shortDesc][aud.Format] ?: []
|
|
|
|
audiosMap[shortDesc][aud.Format] = audiosMap[shortDesc][aud.Format] ?: []
|
|
|
|
audiosMap[shortDesc][aud.Format] << aud
|
|
|
|
audiosMap[shortDesc][aud.Format] << aud
|
|
|
@ -185,9 +183,16 @@ try { //empieza el script
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
def capturedSubs = [:]
|
|
|
|
def capturedSubs = [:]
|
|
|
|
bloqueSubs = '['
|
|
|
|
bloqueSubs = '['
|
|
|
|
for (sub in text) handleSub(sub, capturedSubs)
|
|
|
|
for (int s; s<text.size(); s++){
|
|
|
|
for (entry in capturedSubs) bloqueSubs += (entry.value!='null'?entry.value:'und')+', '
|
|
|
|
if (text[s]==null || s>10) break;
|
|
|
|
bloqueSubs = bloqueSubs.substring(0,bloqueSubs.size()-2)+']'
|
|
|
|
handleSub(text[s], capturedSubs);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
def keysList = capturedSubs.keySet().toList()
|
|
|
|
|
|
|
|
for (index in 0..< keysList.size()) {
|
|
|
|
|
|
|
|
if (index>3){ bloqueSubs+='etc '; break; }
|
|
|
|
|
|
|
|
bloqueSubs += capturedSubs.get(keysList[index]).replace('null','und').replace(" F+","+F").replace("+ F","+F") + ', '
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bloqueSubs = removeLastComa(bloqueSubs)+']'
|
|
|
|
}catch(err){bloqueSubs=''}
|
|
|
|
}catch(err){bloqueSubs=''}
|
|
|
|
/************************/
|
|
|
|
/************************/
|
|
|
|
|
|
|
|
|
|
|
@ -204,15 +209,57 @@ try { //empieza el script
|
|
|
|
def tieneFamiliar = genres.any{ it =~ /Familia|Family/}
|
|
|
|
def tieneFamiliar = genres.any{ it =~ /Familia|Family/}
|
|
|
|
//docu
|
|
|
|
//docu
|
|
|
|
def esDocu = genres.any{ it =~ /Documental|Documentary|Reality/} && !(localize.English.n =~ /Jackass/)
|
|
|
|
def esDocu = genres.any{ it =~ /Documental|Documentary|Reality/} && !(localize.English.n =~ /Jackass/)
|
|
|
|
//anime
|
|
|
|
//Anime ---------- (Animacion encara no es pot perquè depen del infantil)
|
|
|
|
def esAnime = false
|
|
|
|
def esAnime = false
|
|
|
|
def numPaises = info.ProductionCountries.size()
|
|
|
|
def numPaises = info.ProductionCountries.size()
|
|
|
|
def llengu=[]
|
|
|
|
def llengu = normalLang()
|
|
|
|
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
|
|
|
if (tieneAnimacion && info.ProductionCountries.contains("JP") && llengu.contains('jpn')) {
|
|
|
|
esAnime = numPaises==1 || anime /*|| country=="JP"*/
|
|
|
|
esAnime = (numPaises==1 || anime || country=="JP")
|
|
|
|
|
|
|
|
&& ["nemo"].any{!localize.English.n.toLowerCase().contains(it)}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tipoYaSeteado = esDocu || esAnime
|
|
|
|
tipoYaSeteado = esDocu || esAnime
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//***** familiar vs infantil ****
|
|
|
|
|
|
|
|
def esFamiliar = tieneFamiliar
|
|
|
|
|
|
|
|
def infantil = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!tipoYaSeteado) {
|
|
|
|
|
|
|
|
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tieneFamiliar && tieneAnimacion) {
|
|
|
|
|
|
|
|
def noTanInfantil = info.Certifications.US ==~/PG-13/ && info.Certifications.ES!="7"
|
|
|
|
|
|
|
|
if (!noTanInfantil) infantil = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (tieneAnimacion) {
|
|
|
|
|
|
|
|
if (tieneCertificacion) {
|
|
|
|
|
|
|
|
infantil = info.Certifications.US=="G"
|
|
|
|
|
|
|
|
|| info.Certifications.ES==~/Ai|APTA/
|
|
|
|
|
|
|
|
|| info.Certifications.DE==~/0/
|
|
|
|
|
|
|
|
|| info.Certifications.IT=="T"
|
|
|
|
|
|
|
|
|| info.Certifications.IE=="G"
|
|
|
|
|
|
|
|
|| info.Certifications.LT=="V" || info.Certifications.RU ==~ /6.+/
|
|
|
|
|
|
|
|
|| info.Certifications.BR=="L"
|
|
|
|
|
|
|
|
|| info.Certifications.NO=="A"
|
|
|
|
|
|
|
|
|| info.Certifications.FR=="U"
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
def titulosInfantiles = ['boonie bears', 'the jungle bunch']
|
|
|
|
|
|
|
|
if (titulosInfantiles.any { localize.English.n.toLowerCase().contains(it) })
|
|
|
|
|
|
|
|
infantil = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!esFamiliar) {
|
|
|
|
|
|
|
|
if (tieneCertificacion && (
|
|
|
|
|
|
|
|
info.Certifications.US=="G"
|
|
|
|
|
|
|
|
)) {
|
|
|
|
|
|
|
|
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
tipoYaSeteado = tipoYaSeteado || esFamiliar || infantil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//animacion
|
|
|
|
|
|
|
|
def esAnimacion = tieneAnimacion && !infantil
|
|
|
|
|
|
|
|
tipoYaSeteado = tipoYaSeteado || esAnimacion
|
|
|
|
|
|
|
|
|
|
|
|
//*** española ***
|
|
|
|
//*** española ***
|
|
|
|
def espanyola = false
|
|
|
|
def espanyola = false
|
|
|
|
def catalana = false
|
|
|
|
def catalana = false
|
|
|
@ -222,67 +269,36 @@ try { //empieza el script
|
|
|
|
|| { try { info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b/ } catch (e) { false } }()
|
|
|
|
|| { try { info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b/ } catch (e) { false } }()
|
|
|
|
|| { try { info.ProductionCompanies.any{ it =~ /.?TVE|ESDIP|Canal Sur|Canal\+|Telecinco/ } } catch (e) { false } }()
|
|
|
|
|| { try { info.ProductionCompanies.any{ it =~ /.?TVE|ESDIP|Canal Sur|Canal\+|Telecinco/ } } catch (e) { false } }()
|
|
|
|
|| (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
|
|
|
|| (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
|
|
|
|| { llengu=normalLang(llengu); llengu.size()==1 && llengu[0]=~/esp|spa/}()
|
|
|
|
|| llengu.size()==1 && llengu[0]=~/esp|spa/
|
|
|
|
|| (movie.alternativeTitles.size()==1 && movie.alternativeTitles.ES!=null)
|
|
|
|
|| (movie.alternativeTitles.size()==1 && movie.alternativeTitles.ES!=null)
|
|
|
|
|| (country=="ES" && (!llengu.isEmpty() ? llengu.size()==1 && llengu[0]!="eng" : true))
|
|
|
|
|| (country=="ES" && (!llengu.isEmpty() ? llengu.size()==1 && llengu[0]!="eng" : true))
|
|
|
|
if (espanyola) catalana = { llengu=normalLang(llengu); llengu.contains('cat') }()
|
|
|
|
if (espanyola) catalana = llengu.contains('cat')
|
|
|
|
tipoYaSeteado = espanyola
|
|
|
|
tipoYaSeteado = tipoYaSeteado || espanyola
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//***** familiar vs infantil ****
|
|
|
|
|
|
|
|
def esFamiliar = tieneFamiliar
|
|
|
|
|
|
|
|
def infantil = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!tipoYaSeteado) {
|
|
|
|
|
|
|
|
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tieneFamiliar && tieneAnimacion) {
|
|
|
|
|
|
|
|
def noTanInfantil = info.Certifications.US ==~/PG-13/
|
|
|
|
|
|
|
|
if (!noTanInfantil) infantil = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (tieneAnimacion) {
|
|
|
|
|
|
|
|
if (tieneCertificacion) {
|
|
|
|
|
|
|
|
infantil = info.Certifications.US=="G"
|
|
|
|
|
|
|
|
|| info.Certifications.ES==~/Ai|APTA/
|
|
|
|
|
|
|
|
|| info.Certifications.DE==~/0|6/
|
|
|
|
|
|
|
|
|| info.Certifications.IT=="T"
|
|
|
|
|
|
|
|
|| info.Certifications.LT=="V" || info.Certifications.RU ==~ /6.+/
|
|
|
|
|
|
|
|
|| info.Certifications.BR=="L"
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
def titulosInfantiles = ['Bonnie bears', 'The Jungle Bunch']
|
|
|
|
|
|
|
|
if (titulosInfantiles.any { localize.English.n.toLowerCase()contains(it.toLowerCase()) })
|
|
|
|
|
|
|
|
infantil = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!esFamiliar) {
|
|
|
|
|
|
|
|
if (tieneCertificacion && (
|
|
|
|
|
|
|
|
info.Certifications.US=="G"
|
|
|
|
|
|
|
|
)) {
|
|
|
|
|
|
|
|
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
tipoYaSeteado = esFamiliar || infantil
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//asiaticas
|
|
|
|
//asiaticas
|
|
|
|
def asiatica = false
|
|
|
|
def asiatica = false
|
|
|
|
if (!tipoYaSeteado) {
|
|
|
|
if (!tipoYaSeteado) {
|
|
|
|
//asiaticas
|
|
|
|
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
|
|
|
if (numPaises>0) {
|
|
|
|
def paisesIntersec=0
|
|
|
|
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
|
|
|
def languajAsia = ["zho", "kor", "thai", "vie", "jpn", "ind"]
|
|
|
|
def languajAsia = ["zho", "kor", "thai", "vie", "jpn", "ind"]
|
|
|
|
asiatica = (numPaises != 0 && {((paisesIntersec=paisesAsiaticos.intersect(info.ProductionCountries).size()) == numPaises || (/*en observacion*/paisesIntersec!=0 && !llengu.contains('eng')) ) }())
|
|
|
|
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
|
|
|
|| languajAsia.intersect(llengu).size() == languajAsia.size()
|
|
|
|
asiatica = matchP.size() == numPaises
|
|
|
|
//|| {try { languages.any{ languajAsia.contains(it.toString()) } } catch (err) {false} }()
|
|
|
|
//|| {try { languages.any{ languajAsia.contains(it.toString()) } } catch (err) {false} }()
|
|
|
|
//|| matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1 /*en obseracion*/
|
|
|
|
|| { llengu=normalLang(llengu); languajAsia.intersect(llengu).size() == languajAsia.size() }()
|
|
|
|
tipoYaSeteado = tipoYaSeteado || asiatica
|
|
|
|
|| { llengu.size()==1 && llengu[0]=~/esp|spa/}()
|
|
|
|
|
|
|
|
//|| matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1 /*en obseracion*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//es animacion
|
|
|
|
//*** latina ***
|
|
|
|
def esAnimacion = tieneAnimacion && !esFamiliar
|
|
|
|
def latina = false
|
|
|
|
|
|
|
|
if (!tipoYaSeteado) {
|
|
|
|
|
|
|
|
def paisesLatinos = ["MX", "AR"]
|
|
|
|
|
|
|
|
latina = {try {paisesLatinos.contains(country)} catch (e) {false}}()
|
|
|
|
|
|
|
|
|| (numPaises != 0 && paisesLatinos.intersect(info.ProductionCountries).size() == numPaises)
|
|
|
|
|
|
|
|
|| info.productionCompanies.any{it=~/Corazón Films/}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////
|
|
|
|
//tria
|
|
|
|
//tria
|
|
|
|
if (esDocu) ruta = ruta_docu
|
|
|
|
if (esDocu) ruta = ruta_docu
|
|
|
|
else if (esAnime) ruta = ruta_anime
|
|
|
|
else if (esAnime) ruta = ruta_anime
|
|
|
@ -290,6 +306,7 @@ try { //empieza el script
|
|
|
|
else if (esAnimacion) ruta = ruta_animacion
|
|
|
|
else if (esAnimacion) ruta = ruta_animacion
|
|
|
|
else if (catalana) ruta = ruta_cat
|
|
|
|
else if (catalana) ruta = ruta_cat
|
|
|
|
else if (espanyola) ruta = ruta_esp
|
|
|
|
else if (espanyola) ruta = ruta_esp
|
|
|
|
|
|
|
|
else if (latina) ruta = ruta_latina
|
|
|
|
else if (esFamiliar) ruta = ruta_familiar
|
|
|
|
else if (esFamiliar) ruta = ruta_familiar
|
|
|
|
else if (asiatica) ruta = ruta_asiaticas
|
|
|
|
else if (asiatica) ruta = ruta_asiaticas
|
|
|
|
else if (y<1980) ruta = ruta_classic
|
|
|
|
else if (y<1980) ruta = ruta_classic
|
|
|
@ -301,7 +318,7 @@ try { //empieza el script
|
|
|
|
def nombrePelicula_formatoPlex = {try { catalana ? localize.Catalan.n : localize.Spanish.plex.name } catch (err) {localize.Spanish.plex.name} }()
|
|
|
|
def nombrePelicula_formatoPlex = {try { catalana ? localize.Catalan.n : localize.Spanish.plex.name } catch (err) {localize.Spanish.plex.name} }()
|
|
|
|
def inicial = (ruta==rutaOK || ruta==ruta_retro) ? getInicial() : ''
|
|
|
|
def inicial = (ruta==rutaOK || ruta==ruta_retro) ? getInicial() : ''
|
|
|
|
def tmdb = "{tmdb-"+tmdbid+"}"
|
|
|
|
def tmdb = "{tmdb-"+tmdbid+"}"
|
|
|
|
def carpetaPeli = localize.Spanish.plex.name + tmdb + '/'
|
|
|
|
def carpetaPeli = localize.Spanish.plex.name + ' ' + tmdb + '/'
|
|
|
|
def nomPrincipal = nombrePelicula_formatoPlex + bloqueVideo + bloqueAudio + bloqueSubs
|
|
|
|
def nomPrincipal = nombrePelicula_formatoPlex + bloqueVideo + bloqueAudio + bloqueSubs
|
|
|
|
def trackerCatch = fn.find(/(?i)\bHDO(limpo)?\b|\bRedBits\b/)
|
|
|
|
def trackerCatch = fn.find(/(?i)\bHDO(limpo)?\b|\bRedBits\b/)
|
|
|
|
def tracker = trackerCatch != null ? '['+trackerCatch.replace("HDOlimpo", "HDO")+']' : ''
|
|
|
|
def tracker = trackerCatch != null ? '['+trackerCatch.replace("HDOlimpo", "HDO")+']' : ''
|
|
|
@ -309,15 +326,16 @@ try { //empieza el script
|
|
|
|
return ruta + inicial + carpetaPeli + nomPrincipal + tracker + tmdb
|
|
|
|
return ruta + inicial + carpetaPeli + nomPrincipal + tracker + tmdb
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
def msgErr = err.getMessage()
|
|
|
|
|
|
|
|
|
|
|
|
if (ubuntu_desktop) {
|
|
|
|
if (ubuntu_desktop) {
|
|
|
|
String str= err.getStackTrace().toString()
|
|
|
|
String str= err.getStackTrace().toString()
|
|
|
|
def pattern = ( str =~ /groovy.(\d+)./ )
|
|
|
|
def pattern = ( str =~ /groovy.(\d+)./ )
|
|
|
|
return " Error at line number = " + pattern[0][1] + ". more: "+str
|
|
|
|
return " Error at line number = " + pattern[0][1] + ". more: "+msgErr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def rutaMotivoErr
|
|
|
|
def rutaMotivoErr
|
|
|
|
def msgErr = err.getMessage()
|
|
|
|
|
|
|
|
if (msgErr=="[formato_fichero_noestarndar]" || msgErr=="[video_roto]")
|
|
|
|
if (msgErr=="[formato_fichero_noestarndar]" || msgErr=="[video_roto]")
|
|
|
|
rutaMotivoErr="/fichero/"
|
|
|
|
rutaMotivoErr="/fichero/"
|
|
|
|
else if (msgErr=="[genero_no_especificado]" || msgErr=="[certificado_edad_no_especificado]") {
|
|
|
|
else if (msgErr=="[genero_no_especificado]" || msgErr=="[certificado_edad_no_especificado]") {
|
|
|
@ -372,17 +390,20 @@ def getMaxQuality (mapAudioIndexedByFormat) {
|
|
|
|
return null
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
def printAudio (audio2Print) {
|
|
|
|
def printAudio (audio2Print) {
|
|
|
|
def formato_audio = audio2Print.Format_Commercial
|
|
|
|
def format = audio2Print.Format
|
|
|
|
.replaceAll(/Dolby Digital/, 'Dolby')
|
|
|
|
def fCom = audio2Print.Format_Commercial
|
|
|
|
.replaceAll(/ Plus/, 'P')
|
|
|
|
switch (format) {
|
|
|
|
.replaceAll(/DTS-HD Master Audio/, 'DTS-MA')
|
|
|
|
case "AC-3" -> fCom = "DD"
|
|
|
|
.replaceAll(/DTS-HD High Resolution Audio/, 'DTS-HR')
|
|
|
|
case "E-AC-3" -> fCom = "DD+"
|
|
|
|
.replaceAll(/MPEG Audio/, 'MPEG')
|
|
|
|
case "MPEG Audio" -> fCom = "MPEG"
|
|
|
|
.replaceAll(/HE-AAC/, 'hAAC')
|
|
|
|
case "DTS" -> { if (fCom.contains("Master Audio")) fCom="DTS_MA"
|
|
|
|
.replaceAll(/ with Dolby Atmos/, 'Atmos')
|
|
|
|
else if (fCom.contains("DTS-HD High Resolution Audio")) fCom="DTS_HRA"
|
|
|
|
.replaceAll(/TrueHD/, 'tHD')
|
|
|
|
else if (fCom.contains("DTS-ES")) fCom="DTS-ES"
|
|
|
|
def canales = audio2Print.Channels.replace(2:'2.0', 6:'5.1', 8:'7.1')
|
|
|
|
}
|
|
|
|
return formato_audio + ' ' + canales
|
|
|
|
case "MLP FBA" -> {def tmp = "D_HD"; if (fCom.contains("Atmos")) tmp+="_Atmos"; fCom = tmp}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
def canales = audio2Print.Channels.replace(2:'2.0', 6:'5.1', 7:'6.1', 8:'7.1')
|
|
|
|
|
|
|
|
return fCom + ' ' + canales
|
|
|
|
}
|
|
|
|
}
|
|
|
|
def getBestChannelFromList (audiosFormatFound) {
|
|
|
|
def getBestChannelFromList (audiosFormatFound) {
|
|
|
|
def bestChanel
|
|
|
|
def bestChanel
|
|
|
@ -413,7 +434,7 @@ def handleSub(sub, capturedSubs) {
|
|
|
|
def newTxt=''+existing
|
|
|
|
def newTxt=''+existing
|
|
|
|
if (!existing.contains('+')) newTxt += '+'
|
|
|
|
if (!existing.contains('+')) newTxt += '+'
|
|
|
|
if (forced && !existing.contains('F')) newTxt += ' F'
|
|
|
|
if (forced && !existing.contains('F')) newTxt += ' F'
|
|
|
|
capturedSubs[lang]=newTxt.replace(" F+","+F")
|
|
|
|
capturedSubs[lang]=newTxt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -428,8 +449,9 @@ def getInicial () {
|
|
|
|
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
|
|
|
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
|
|
|
return inicial
|
|
|
|
return inicial
|
|
|
|
}
|
|
|
|
}
|
|
|
|
def normalLang(langs) {
|
|
|
|
def normalLang() {
|
|
|
|
return langs.isEmpty() ? {try { for (lan in languages) langs.add(lan.toString()); return langs } catch(err) {langs}}() : langs
|
|
|
|
def langs=[]
|
|
|
|
|
|
|
|
return {try { for (lan in languages) langs.add(lan.toString()); return langs } catch(err) {langs}}()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
def sanityCheck(newId) {
|
|
|
|
def sanityCheck(newId) {
|
|
|
|
def oldId = fn.find(/\{tmdb-\d+\}/)?.find(/\d+/)
|
|
|
|
def oldId = fn.find(/\{tmdb-\d+\}/)?.find(/\d+/)
|
|
|
|