Actualizar robot.js

This commit is contained in:
2026-04-06 19:16:57 +00:00
parent bab7c4a55b
commit b398d0a072

View File

@@ -281,7 +281,7 @@ async function runMultiasistencia(ownerId, user, pass, gremiosDB) {
}
// ==========================================
// 🧹 HOMESERVE (ROBOT MEJORADO Y DETECTOR DE URGENCIAS)
// 🧹 HOMESERVE (ROBOT MEJORADO + CAMUFLAJE ANTI-BOTS)
// ==========================================
async function runHomeserve(ownerId, user, pass, gremiosDB) {
const browser = await chromium.launch({
@@ -290,10 +290,29 @@ async function runHomeserve(ownerId, user, pass, gremiosDB) {
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-gpu'
'--disable-gpu',
'--disable-blink-features=AutomationControlled' // 1. Oculta que es un bot automatizado
]
});
const page = await browser.newPage();
// 2. Le ponemos el DNI de un Chrome normal en Windows 10
const context = await browser.newContext({
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
viewport: { width: 1366, height: 768 }, // Tamaño de pantalla típico
hasTouch: false
});
const page = await context.newPage();
// 3. Borramos la variable chivata de Playwright antes de que cargue la web
await page.addInitScript(() => {
Object.defineProperty(navigator, 'webdriver', { get: () => undefined });
});
try {
console.log("🌍 [HomeServe] Entrando a la web (Modo Sigilo Activado)...");
await gotoWithRetry(page, 'https://www.clientes.homeserve.es/cgi-bin/fccgi.exe?w3exec=PROF_PASS');
// ... el resto de la función sigue exactamente igual ...
try {
console.log("🌍 [HomeServe] Entrando a la web...");
await gotoWithRetry(page, 'https://www.clientes.homeserve.es/cgi-bin/fccgi.exe?w3exec=PROF_PASS');