Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,115 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="hi">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Premium Temp Mail (ElevenLabs Bypass)</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
</head>
|
| 9 |
+
<body class="bg-slate-900 text-white min-h-screen p-5">
|
| 10 |
+
<div class="max-w-2xl mx-auto bg-slate-800 p-6 rounded-2xl shadow-2xl border border-slate-700">
|
| 11 |
+
<h1 class="text-3xl font-bold mb-6 text-center text-blue-400">Advanced Temp Mail</h1>
|
| 12 |
+
|
| 13 |
+
<div class="space-y-4">
|
| 14 |
+
<div>
|
| 15 |
+
<label class="block text-sm mb-1 text-slate-400">Aapka Temporary Email:</label>
|
| 16 |
+
<div class="flex gap-2">
|
| 17 |
+
<input id="mail-address" readonly class="w-full bg-slate-700 border border-slate-600 p-3 rounded-lg font-mono text-green-400" placeholder="Generating email...">
|
| 18 |
+
<button onclick="copyEmail()" class="bg-blue-600 hover:bg-blue-700 px-6 rounded-lg transition">Copy</button>
|
| 19 |
+
</div>
|
| 20 |
+
</div>
|
| 21 |
+
|
| 22 |
+
<button onclick="createNewEmail()" class="w-full bg-green-600 hover:bg-green-700 p-3 rounded-lg font-bold transition">Naya Email Banayein</button>
|
| 23 |
+
|
| 24 |
+
<div class="mt-8">
|
| 25 |
+
<div class="flex justify-between items-center mb-4">
|
| 26 |
+
<h2 class="text-xl font-semibold">Inbox</h2>
|
| 27 |
+
<span id="status" class="text-xs text-slate-500 italic font-mono">Auto-checking...</span>
|
| 28 |
+
</div>
|
| 29 |
+
<div id="inbox-list" class="space-y-3">
|
| 30 |
+
<p class="text-center text-slate-500 py-10">Messages ka intezar hai... (ElevenLabs ka OTP yaha aayega)</p>
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
</div>
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<script>
|
| 37 |
+
const API = "https://api.mail.gw";
|
| 38 |
+
let userData = { address: "", password: "", token: "" };
|
| 39 |
+
|
| 40 |
+
async function createNewEmail() {
|
| 41 |
+
document.getElementById('mail-address').value = "Generating...";
|
| 42 |
+
try {
|
| 43 |
+
// 1. Get Domain
|
| 44 |
+
const domainRes = await fetch(`${API}/domains`);
|
| 45 |
+
const domains = await domainRes.json();
|
| 46 |
+
const domain = domains['hydra:member'][0].domain;
|
| 47 |
+
|
| 48 |
+
// 2. Create Account
|
| 49 |
+
const randomUser = Math.random().toString(36).substring(7);
|
| 50 |
+
const address = `${randomUser}@${domain}`;
|
| 51 |
+
const password = "Password123!";
|
| 52 |
+
|
| 53 |
+
const regRes = await fetch(`${API}/accounts`, {
|
| 54 |
+
method: 'POST',
|
| 55 |
+
headers: { 'Content-Type': 'application/json' },
|
| 56 |
+
body: JSON.stringify({ address, password })
|
| 57 |
+
});
|
| 58 |
+
|
| 59 |
+
if (regRes.ok) {
|
| 60 |
+
// 3. Get Token (Login)
|
| 61 |
+
const loginRes = await fetch(`${API}/token`, {
|
| 62 |
+
method: 'POST',
|
| 63 |
+
headers: { 'Content-Type': 'application/json' },
|
| 64 |
+
body: JSON.stringify({ address, password })
|
| 65 |
+
});
|
| 66 |
+
const loginData = await loginRes.json();
|
| 67 |
+
|
| 68 |
+
userData = { address, password, token: loginData.token };
|
| 69 |
+
document.getElementById('mail-address').value = address;
|
| 70 |
+
checkInbox();
|
| 71 |
+
}
|
| 72 |
+
} catch (err) {
|
| 73 |
+
alert("Error: " + err);
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
async function checkInbox() {
|
| 78 |
+
if (!userData.token) return;
|
| 79 |
+
document.getElementById('status').innerText = "Checking...";
|
| 80 |
+
|
| 81 |
+
try {
|
| 82 |
+
const res = await fetch(`${API}/messages`, {
|
| 83 |
+
headers: { 'Authorization': `Bearer ${userData.token}` }
|
| 84 |
+
});
|
| 85 |
+
const data = await res.json();
|
| 86 |
+
const messages = data['hydra:member'];
|
| 87 |
+
const list = document.getElementById('inbox-list');
|
| 88 |
+
|
| 89 |
+
if (messages.length > 0) {
|
| 90 |
+
list.innerHTML = "";
|
| 91 |
+
messages.forEach(msg => {
|
| 92 |
+
const div = document.createElement('div');
|
| 93 |
+
div.className = "p-4 bg-slate-700 rounded-lg border-l-4 border-blue-500 cursor-pointer hover:bg-slate-600";
|
| 94 |
+
div.innerHTML = `<strong>From: ${msg.from.address}</strong><br><small>${msg.subject}</small>`;
|
| 95 |
+
div.onclick = () => alert("Email Content check karne ke liye API call expand karein.");
|
| 96 |
+
list.appendChild(div);
|
| 97 |
+
});
|
| 98 |
+
}
|
| 99 |
+
} catch (err) { console.log(err); }
|
| 100 |
+
|
| 101 |
+
document.getElementById('status').innerText = "Auto-checking...";
|
| 102 |
+
setTimeout(checkInbox, 10000);
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
function copyEmail() {
|
| 106 |
+
const input = document.getElementById('mail-address');
|
| 107 |
+
input.select();
|
| 108 |
+
document.execCommand('copy');
|
| 109 |
+
alert("Email copy ho gaya!");
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
window.onload = createNewEmail;
|
| 113 |
+
</script>
|
| 114 |
+
</body>
|
| 115 |
+
</html>
|