const axios = require('axios'); async function aidetector(text) { try { if (!text) throw new Error('Text is required.'); const { data: a } = await axios.post('https://undetectable.ai/detector-humanizer', [text, 'l6_v6', false], { headers: { 'next-action': '8b888df218472b367d6709b65423720937e55d44', 'next-router-state-tree': '%5B%22%22%2C%7B%22children%22%3A%5B%5B%22locale%22%2C%22en%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22(pages-with-loader)%22%2C%7B%22children%22%3A%5B%22detector-humanizer%22%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2Fdetector-humanizer%22%2C%22refresh%22%5D%7D%5D%7D%5D%7D%5D%7D%2Cnull%2Cnull%2Ctrue%5D', origin: 'https://undetectable.ai', referer: 'https://undetectable.ai/detector-humanizer', 'user-agent': 'Mozilla/5.0 (Linux; Android 15; SM-F958 Build/AP3A.240905.015) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.86 Mobile Safari/537.36', 'x-deployment-id': 'dpl_5AoF5tkK5GdFjjV23UefgnT3Bd4W' } }); const id = a.match(/"id":"([^"]+)"/)?.[1]; if (!id) throw new Error('ID not found.'); const { data } = await axios.post('https://sea-lion-app-3p5x4.ondigitalocean.app/query', { id: id }, { origin: 'https://undetectable.ai', referer: 'https://undetectable.ai/', 'user-agent': 'Mozilla/5.0 (Linux; Android 15; SM-F958 Build/AP3A.240905.015) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.86 Mobile Safari/537.36' }); return data; } catch (error) { throw new Error(error.message); } } // Usage: aidetector(`The old lighthouse stood sentinel on the rugged cliff, its white-painted tower weathered by decades of salt spray and ocean winds. Each evening as the sun dipped below the horizon, painting the sky in brilliant streaks of orange and purple, the lighthouse keeper would climb the spiral staircase to ignite the beacon that had guided countless sailors safely home. The rhythmic crash of waves against the rocks below created a hypnotic symphony, while seabirds circled overhead, their cries echoing through the salty air. Inside the keeper's cottage, warm light glowed from small windows, promising shelter and comfort against the wild, untamed beauty of the coastal landscape that stretched endlessly in all directions.`).then(console.log);