tamax / Alightmotion Premium
Generator Akun Alightmotion Premium
APIJavaScript
2 views
Generator Akun Alightmotion Premium
const axios = require('axios');
const cheerio = require('cheerio');
const WebSocket = require('ws');
const fs = require('fs');
const readline = require('readline');
const config = {
apiBase: 'https://generator.email/',
maxRetry: 3,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
'Accept-Language': 'id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Pragma': 'no-cache'
}
};
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
class EmailGenerator {
constructor() {
this.baseUrl = 'https://generator.email/';
this.client = axios.create({
timeout: 15000,
maxRedirects: 5,
validateStatus: () => true,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
'Accept-Language': 'id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Pragma': 'no-cache'
}
});
this.cookie = '';
this.username = '';
this.domain = '';
}
_updateCookie(response) {
const setCookie = response.headers['set-cookie'];
if (setCookie) {
const newCookies = setCookie.map(c => c.split(';')[0]);
const existing = this.cookie ? this.cookie.split('; ') : [];
const map = new Map();
existing.forEach(c => {
const key = c.split('=')[0].trim();
if (key) map.set(key, c);
});
newCookies.forEach(c => {
const key = c.split('=')[0].trim();
if (key) map.set(key, c);
});
this.cookie = Array.from(map.values()).join('; ');
}
}
async createEmail() {
const response = await this.client.get(this.baseUrl);
this._updateCookie(response);
const $ = cheerio.load(response.data);
let email = $('#email_ch_text').text().trim();
if (!email || !email.includes('@')) {
const user = $('#userName').val();
const domain = $('#domainName2').val();
if (user && domain) email = `${user}@${domain}`;
}
if (!email || !email.includes('@')) {
throw new Error('Gagal Mendapatkan Alamat Email Dari Halaman');
}
const [username, domain] = email.split('@');
this.username = username;
this.domain = domain;
return { email, username, domain };
}
async fetchMessageDetail() {
try {
const url = `${this.baseUrl}${this.domain}/${this.username}`;
const resp = await this.client.get(url, {
headers: {
'Cookie': this.cookie || '',
'Referer': this.baseUrl
}
});
this._updateCookie(resp);
const $ = cheerio.load(resp.data);
let bodyElement = $('#mail-summary-body .mess_bodiyy');
let bodyHtml = bodyElement.html() || '';
let bodyText = bodyElement.text().trim();
if (!bodyHtml) {
const fullText = $('body').text() || '';
const fullHtml = $('body').html() || '';
if (
fullText.includes('alight-creative') ||
fullText.includes('alightcreative') ||
fullText.includes('Alight Motion') ||
fullText.includes('Sign in to Alight')
) {
bodyHtml = fullHtml;
bodyText = fullText;
}
}
let verificationLink = null;
if (bodyHtml) {
const $body = cheerio.load(bodyHtml);
$body('a[href]').each((i, el) => {
const href = $body(el).attr('href');
if (href && (href.includes('firebaseapp.com') || href.includes('alightcreative.com'))) {
verificationLink = href;
return false;
}
});
}
if (!verificationLink) {
$('a[href]').each((i, el) => {
const href = $(el).attr('href');
if (href && (href.includes('firebaseapp.com') || href.includes('alightcreative.com'))) {
verificationLink = href;
return false;
}
});
}
if (!verificationLink && bodyText) {
const urls = bodyText.match(/https?:\/\/[^\s<>"']+/g) || [];
verificationLink = urls.find(u =>
u.includes('alight-creative.firebaseapp.com') ||
u.includes('alightcreative.com') ||
u.includes('firebaseapp.com')
) || null;
}
return { verificationLink, bodyHtml, bodyText };
} catch (err) {
return { verificationLink: null, bodyHtml: '', bodyText: '' };
}
}
async waitForEmail(timeoutMs = 90000) {
const email = `${this.username}@${this.domain}`;
return new Promise((resolve, reject) => {
const wsUrl = `wss://generator.email/notificon/ws?email=${encodeURIComponent(email)}`;
const ws = new WebSocket(wsUrl);
let settled = false;
const timer = setTimeout(() => {
if (!settled) {
settled = true;
ws.close();
resolve([]);
}
}, timeoutMs);
ws.on('open', () => {});
ws.on('message', async (raw) => {
if (settled) return;
try {
const msg = JSON.parse(raw);
settled = true;
clearTimeout(timer);
const detail = await this.fetchMessageDetail();
msg.verificationLink = detail.verificationLink;
msg.bodyHtml = detail.bodyHtml;
msg.bodyText = detail.bodyText;
ws.close();
resolve([msg]);
} catch (e) {
}
});
ws.on('error', (err) => {
if (!settled) {
settled = true;
clearTimeout(timer);
reject(err);
}
});
ws.on('close', () => {
if (!settled) {
settled = true;
clearTimeout(timer);
resolve([]);
}
});
});
}
}
const utils = {
sleep: (ms) => new Promise(resolve => setTimeout(resolve, ms)),
getDateStr: () => {
const now = new Date();
const y = now.getFullYear();
const m = String(now.getMonth() + 1).padStart(2, '0');
const d = String(now.getDate()).padStart(2, '0');
return `${y}-${m}-${d}`;
},
extractVerificationLink: (message) => {
if (!message) return null;
if (message.verificationLink) return message.verificationLink;
if (message.html || message.bodyHtml) {
const html = message.html || message.bodyHtml;
const $ = cheerio.load(html);
let foundLink = null;
$('a[href]').each((i, el) => {
const href = $(el).attr('href');
if (href && (
href.includes('firebaseapp.com') ||
href.includes('alightcreative.com') ||
href.includes('alight-creative.firebaseapp.com')
)) {
foundLink = href;
return false;
}
});
if (foundLink) return foundLink;
}
const textToSearch = (message.text || message.bodyText || '') + ' ' + (message.subject || '');
const urlRegex = /https?:\/\/[^\s<>"']+/g;
const urls = textToSearch.match(urlRegex) || [];
const verificationLink = urls.find(u =>
u.includes('alight-creative.firebaseapp.com') ||
u.includes('alightcreative.com') ||
u.includes('firebaseapp.com')
);
return verificationLink || null;
}
};
class AlightMotionAuth {
constructor(apiKey) {
this.apiKey = ""; // Beli ke WhatsApp wa.me/6289505264091
this.baseUrl = 'https://alightmotion.pratamamd.web.id/alightmotion';
}
async sendMagicLink(email) {
const url = `${this.baseUrl}/send?apikey=${encodeURIComponent(this.apiKey)}&email=${encodeURIComponent(email)}`;
const response = await axios.get(url, { timeout: 30000 });
if (response.data && response.data.status === true) {
return { success: true, data: response.data.data };
}
throw new Error(response.data?.message || 'Gagal mengirim magic link');
}
async verifyAndActivate(email, rawLink) {
const url = `${this.baseUrl}/verify?apikey=${encodeURIComponent(this.apiKey)}&email=${encodeURIComponent(email)}&link=${encodeURIComponent(rawLink)}`;
const response = await axios.get(url, { timeout: 30000 });
if (response.data && response.data.status === true) {
return { success: true, data: response.data.data };
}
throw new Error(response.data?.message || 'Gagal verifikasi & aktivasi premium');
}
}
let totalAccounts = 0;
let completedAccounts = 0;
let successCount = 0;
let failCount = 0;
let outputData = [];
let outputFile = '';
function progressBar(percent, width = 32) {
const fill = Math.floor(width * percent / 100);
return `[${'█'.repeat(fill)}${'░'.repeat(width - fill)}] ${percent}%`;
}
function updateProgress(percent, status) {
readline.cursorTo(process.stdout, 0, 1);
readline.clearLine(process.stdout, 0);
process.stdout.write(progressBar(percent));
readline.cursorTo(process.stdout, 0, 2);
readline.clearLine(process.stdout, 0);
process.stdout.write(`Status : ${status}`);
}
function autoSave() {
if (outputFile && outputData.length > 0) {
try { fs.writeFileSync(outputFile, outputData.join('\n') + '\n', 'utf8'); } catch (e) {}
}
}
class CLI {
constructor() {
this.mail = new EmailGenerator();
this.alight = new AlightMotionAuth();
}
async run() {
console.clear();
console.log('=== Alight Motion Premium Auto Generator ===\n');
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
const answer = await new Promise(resolve => rl.question('Masukkan Jumlah Generate Akun : ', resolve));
rl.close();
totalAccounts = parseInt(answer.trim());
if (isNaN(totalAccounts) || totalAccounts <= 0) {
console.error('Jumlah Tidak Valid !!');
process.exit(1);
}
outputFile = `AMPrem-${totalAccounts}-${utils.getDateStr()}.txt`;
console.log('\n\n');
updateProgress(0, 'Memulai...');
for (let i = 1; i <= totalAccounts; i++) {
completedAccounts = i - 1;
const percent = totalAccounts > 0 ? Math.floor((completedAccounts / totalAccounts) * 100) : 0;
updateProgress(percent, `Memproses Akun ${i}/${totalAccounts}`);
await this.processAccount(i);
completedAccounts = i;
autoSave();
if (i < totalAccounts) await utils.sleep(1500);
}
updateProgress(100, 'Selesai.');
process.stdout.write('\n\n');
console.log(`Sukses : ${successCount} | Gagal : ${failCount}`);
console.log(`File : ${outputFile} (${outputData.length} akun)`);
process.exit(0);
}
async processAccount(index) {
let email = '', verificationLink = null;
const statusBase = `Akun ${index}/${totalAccounts}`;
try {
updateProgress(Math.floor(((index-1)/totalAccounts)*100), `${statusBase} - Membuat Email...`);
const account = await this.mail.createEmail();
email = account.email;
updateProgress(Math.floor(((index-1)/totalAccounts)*100), `${statusBase} - Mengirim Magic Link...`);
await this.alight.sendMagicLink(email);
updateProgress(Math.floor(((index-1)/totalAccounts)*100), `${statusBase} - Menunggu Email Verifikasi (WebSocket)...`);
const messages = await this.mail.waitForEmail(90000);
if (messages.length > 0) {
verificationLink = utils.extractVerificationLink(messages[0]);
}
if (!verificationLink) throw new Error('Link Verifikasi Tidak ditemukan');
updateProgress(Math.floor(((index-1)/totalAccounts)*100), `${statusBase} - Verifikasi & Aktivasi Premium...`);
await this.alight.verifyAndActivate(email, verificationLink);
successCount++;
outputData.push(`${email}`);
const percent = totalAccounts > 0 ? Math.floor((index / totalAccounts) * 100) : 0;
updateProgress(percent, `${statusBase} - Berhasil.`);
} catch (err) {
failCount++;
const percent = totalAccounts > 0 ? Math.floor(((index-1)/totalAccounts)*100) : 0;
updateProgress(percent, `${statusBase} - Gagal : ${err.message}`);
}
}
}
function setupSignalHandlers() {
['SIGINT', 'SIGTERM', 'SIGHUP'].forEach(signal => {
process.on(signal, () => {
process.stdout.write('\n\n');
console.log('Menyimpan Data Sebelum Keluar...');
autoSave();
process.exit(0);
});
});
}
(async () => {
try {
setupSignalHandlers();
const app = new CLI();
await app.run();
} catch (err) {
console.error('Fatal Error :', err.message);
process.exit(1);
}
})();