scraperjavascript14329
Generator.email - Temporary Email & Live Mailbox Scraper
Scraper Generator.email untuk generate email sementara, custom email domain, pencarian domain aktif, cek uptime, serta live websocket inbox.
Vamz Spectre7 Nov 2026299 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/generator-email" -o generator-email.js
# 2. Jalankan script
node generator-email.js
Dependencies npm yang Dibutuhkan:
npm install axios, cheerio, wsPanduan Penggunaan:
Eksekusi CLI: node generator-email.js atau node generator-email.js --inbox="[email protected]"
generator-email.js(299 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/**
* Generator.email Scraper & TempMail Client
* Author: Vamz Spectre / VamxAPI
* Website: https://vamxapi.my.id
*
* Cara Instalasi Dependencies:
* npm install axios cheerio ws
*
* Cara Download File Ini 1:1:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/generator-email" -o generator-email.js
*
* Contoh Penggunaan CLI:
* - Generate email baru:
* node generator-email.js
* - Custom email:
* node generator-email.js "[email protected]"
* - Cek inbox email:
* node generator-email.js --inbox="[email protected]"
* - Cari domain tempmail:
* node generator-email.js --search="gmail"
* - Cek semua domain aktif:
* node generator-email.js --domains
* - Cek uptime domain email:
* node generator-email.js --uptime="[email protected]"
*/
const axios = require('axios');
const cheerio = require('cheerio');
const WebSocket = require('ws');
const BASE_URL = 'https://generator.email';
const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36';
class GeneratorEmail {
constructor() {
this.cookies = {};
this.token = '';
this.currentEmail = '';
this.currentUser = '';
this.currentDomain = '';
}
_parseCookies(setCookieHeader) {
if (!setCookieHeader) return;
const headerArr = Array.isArray(setCookieHeader) ? setCookieHeader : [setCookieHeader];
headerArr.forEach(c => {
const part = c.split(';')[0];
const [k, ...v] = part.split('=');
if (k && v) {
this.cookies[k.trim()] = v.join('=').trim();
}
});
}
_cookieHeader() {
return Object.entries(this.cookies).map(([k, v]) => `${k}=${v}`).join('; ');
}
async init(customEmail) {
const res = await axios.get(BASE_URL, {
headers: {
'User-Agent': USER_AGENT,
'Cookie': this._cookieHeader()
}
});
this._parseCookies(res.headers['set-cookie']);
const $ = cheerio.load(res.data);
this.token = $('meta[name="api-token"]').attr('content') || '';
this.currentUser = $('#userName').val() || '';
this.currentDomain = $('#domainName2').val() || '';
this.currentEmail = `${this.currentUser}@${this.currentDomain}`;
if (customEmail && customEmail.includes('@')) {
return await this.switchMailbox(customEmail);
}
return {
email: this.currentEmail,
user: this.currentUser,
domain: this.currentDomain,
token: this.token
};
}
async getDomains() {
if (!this.token) await this.init();
const res = await axios.get(`${BASE_URL}/api/domains.php`, {
headers: {
'User-Agent': USER_AGENT,
'X-API-Token': this.token,
'X-Requested-With': 'XMLHttpRequest',
'Referer': `${BASE_URL}/`,
'Cookie': this._cookieHeader()
}
});
return res.data;
}
async searchDomains(query) {
if (!this.token) await this.init();
const res = await axios.get(`${BASE_URL}/search.php?key=${encodeURIComponent(query)}`, {
headers: {
'User-Agent': USER_AGENT,
'X-API-Token': this.token,
'X-Requested-With': 'XMLHttpRequest',
'Referer': `${BASE_URL}/`,
'Cookie': this._cookieHeader()
}
});
return res.data;
}
async switchMailbox(email) {
if (!email || !email.includes('@')) {
throw new Error('Format email tidak valid. Gunakan [email protected]');
}
const [user, domain] = email.split('@');
const res = await axios.get(`${BASE_URL}/${encodeURIComponent(user)}@${encodeURIComponent(domain)}`, {
maxRedirects: 5,
headers: {
'User-Agent': USER_AGENT,
'Referer': `${BASE_URL}/`,
'Cookie': this._cookieHeader()
}
});
this._parseCookies(res.headers['set-cookie']);
this.currentUser = user;
this.currentDomain = domain;
this.currentEmail = email;
const $ = cheerio.load(res.data);
const newToken = $('meta[name="api-token"]').attr('content');
if (newToken) this.token = newToken;
return {
status: true,
email: this.currentEmail,
user: this.currentUser,
domain: this.currentDomain
};
}
async getInbox(email) {
if (email && email !== this.currentEmail) {
await this.switchMailbox(email);
} else if (!this.currentEmail) {
await this.init();
}
const res = await axios.get(`${BASE_URL}/inbox7/`, {
headers: {
'User-Agent': USER_AGENT,
'Referer': `${BASE_URL}/`,
'Cookie': this._cookieHeader()
}
});
this._parseCookies(res.headers['set-cookie']);
const $ = cheerio.load(res.data);
const messages = [];
$('#email-table .list-group-item').each((_, el) => {
const from = $(el).find('.from_div_45g45gg').text().trim();
const subject = $(el).find('.subj_div_45g45gg').text().trim();
const time = $(el).find('.time_div_45g45gg').text().trim();
const onclick = $(el).attr('onclick') || '';
const match = onclick.match(/loadInboxClientSide\(['"]([^'"]+)['"]\)/);
const link = match ? match[1] : '';
if (from || subject) {
messages.push({
from,
subject,
time,
link: link ? `${BASE_URL}${link.startsWith('/') ? '' : '/'}${link}` : ''
});
}
});
return {
status: true,
email: this.currentEmail,
totalMessages: messages.length,
messages
};
}
async checkUptime(email) {
if (!email) email = this.currentEmail;
if (!email) await this.init();
const [user, domain] = email.split('@');
const res = await axios.post(`${BASE_URL}/uptime.php`, `dmn=${encodeURIComponent(domain)}&usr=${encodeURIComponent(user)}`, {
headers: {
'User-Agent': USER_AGENT,
'Content-Type': 'application/x-www-form-urlencoded',
'X-API-Token': this.token,
'Referer': `${BASE_URL}/`,
'Cookie': this._cookieHeader()
}
});
return res.data;
}
listenInbox(email, onMessage, timeoutMs = 60000) {
const targetEmail = (email || this.currentEmail).toLowerCase();
const wsUrl = `wss://generator.email/notificon/ws?email=${encodeURIComponent(targetEmail)}`;
const ws = new WebSocket(wsUrl, {
headers: {
'User-Agent': USER_AGENT,
'Origin': BASE_URL
}
});
let timer = null;
return new Promise((resolve, reject) => {
if (timeoutMs > 0) {
timer = setTimeout(() => {
ws.close();
resolve({ status: true, message: 'Listening timeout reached' });
}, timeoutMs);
}
ws.on('open', () => {});
ws.on('message', (data) => {
try {
const parsed = JSON.parse(data.toString());
if (onMessage) onMessage(parsed);
} catch (e) {}
});
ws.on('close', () => {
if (timer) clearTimeout(timer);
resolve({ status: true, message: 'Closed' });
});
ws.on('error', (err) => {
if (timer) clearTimeout(timer);
reject(err);
});
});
}
}
async function main() {
const arg = process.argv[2] || '--generate';
const api = new GeneratorEmail();
try {
if (arg === '--domains') {
const domains = await api.getDomains();
console.log(JSON.stringify({ status: true, total: domains.length, domains: domains.slice(0, 30) }, null, 2));
} else if (arg.startsWith('--search=')) {
const q = arg.replace('--search=', '');
const results = await api.searchDomains(q);
console.log(JSON.stringify({ status: true, query: q, results }, null, 2));
} else if (arg.startsWith('--inbox=')) {
const mail = arg.replace('--inbox=', '');
const inbox = await api.getInbox(mail);
console.log(JSON.stringify(inbox, null, 2));
} else if (arg.startsWith('--uptime=')) {
const mail = arg.replace('--uptime=', '');
const uptime = await api.checkUptime(mail);
console.log(JSON.stringify({ status: true, email: mail, uptime }, null, 2));
} else {
const custom = arg === '--generate' ? null : arg;
const res = await api.init(custom);
const uptime = await api.checkUptime(res.email);
console.log(JSON.stringify({
status: true,
email: res.email,
user: res.user,
domain: res.domain,
uptime,
actions: {
checkInbox: `node generator-email.js --inbox=${res.email}`,
checkUptime: `node generator-email.js --uptime=${res.email}`,
searchDomain: `node generator-email.js --search=mail`,
listDomains: `node generator-email.js --domains`
}
}, null, 2));
}
} catch (err) {
console.error(JSON.stringify({ status: false, error: err.message }, null, 2));
process.exit(1);
}
}
if (require.main === module) {
main();
}
module.exports = GeneratorEmail;