03-sep: [feature] busqueda global solo torrents en castellano (doblada/dual)
This commit is contained in:
@@ -39,6 +39,13 @@ OTRO_IDIOMA_GLOBAL = re.compile(
|
||||
re.IGNORECASE)
|
||||
RUSO = re.compile(r"[а-яА-ЯёЁ]")
|
||||
|
||||
# AUDIO EN CASTELLANO (doblada). Marcadores reales de doblaje ES o pista
|
||||
# multiaudio que incluye ES. Se exige que coincida para mostrar el torrent.
|
||||
CASTELLANO_AUDIO = re.compile(
|
||||
r"(Esp[añ]ol|Castellano|Spanish|Latino|DualLat|\bdual\b|\bmulti[ _-]?audio\b|"
|
||||
r"^Es[ ._-]|\bEs-Es\b|\bESP\b)",
|
||||
re.IGNORECASE)
|
||||
|
||||
|
||||
def _get_json(url, timeout=35):
|
||||
req = urllib.request.Request(url, headers=HEADERS)
|
||||
@@ -141,16 +148,18 @@ def _calidad(texto):
|
||||
|
||||
|
||||
def filtrar_torrents(torrents, limite=20):
|
||||
"""Descarta calidad mala y contenido claramente no en castellano/ingles."""
|
||||
"""Solo torrents con audio en CASTELLANO (doblada/dual). Descarta el resto."""
|
||||
utiles = []
|
||||
for t in torrents:
|
||||
if vcb.CALIDAD_MALA.search(t["title"]):
|
||||
titulo = t["title"]
|
||||
if vcb.CALIDAD_MALA.search(titulo):
|
||||
continue
|
||||
if vcb.OTRO_IDIOMA.search(t["title"]) or OTRO_IDIOMA_GLOBAL.search(t["title"]):
|
||||
if vcb.OTRO_IDIOMA.search(titulo) or OTRO_IDIOMA_GLOBAL.search(titulo):
|
||||
continue
|
||||
if RUSO.search(t["title"]):
|
||||
if RUSO.search(titulo):
|
||||
continue
|
||||
if not (vcb.CASTELLANO.search(t["title"]) or vcb.INGLES.search(t["title"])):
|
||||
# EXIGIR audio en castellano: sin marcador de doblaje ES, se descarta
|
||||
if not CASTELLANO_AUDIO.search(titulo):
|
||||
continue
|
||||
utiles.append(t)
|
||||
# Ordenar: mejor calidad, mas seeders
|
||||
|
||||
Reference in New Issue
Block a user