├── README.md ├── cookies.txt ├── main.js ├── package.json └── proxies.txt /README.md: -------------------------------------------------------------------------------- 1 | Link ref ủng hộ tôi: https://hub.beamable.network/ref/M3WGXSRD 2 | -------------------------------------------------------------------------------- /cookies.txt: -------------------------------------------------------------------------------- 1 | F12 -> Network -> chọn bất kỳ API -> Copy Cookie -> Paste // Mỗi dòng tương ứng với 1 tài khoản 2 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | import fs from "fs/promises"; 2 | import { HttpsProxyAgent } from "https-proxy-agent"; 3 | import fetch from "node-fetch"; 4 | import chalk from "chalk"; 5 | import readline from 'readline/promises'; 6 | 7 | 8 | // Helper Function: Logger 9 | function logger(message, level = "info") { 10 | const now = new Date().toISOString(); 11 | const colors = { 12 | info: chalk.blue, 13 | warn: chalk.yellow, 14 | error: chalk.red, 15 | success: chalk.green, 16 | debug: chalk.magenta, 17 | }; 18 | const color = colors[level] || chalk.white; 19 | console.log(color(`[${now}] [${level.toUpperCase()}]: ${message}`)); 20 | } 21 | 22 | const headers = { 23 | "accept": "text/x-component", 24 | "accept-language": "en-US,en;q=0.9,vi;q=0.8", 25 | "content-type": "text/plain;charset=UTF-8", 26 | "next-router-state-tree": "%5B%22%22%2C%7B%22children%22%3A%5B%5B%22host%22%2C%22hub.beamable.network%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22modules%22%2C%7B%22children%22%3A%5B%5B%22moduleIdOrPath%22%2C%22questsold%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%5B%22moduleNestedId1%22%2C%227570%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2Fmodules%2Fquestsold%2F7570%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%2Ctrue%5D", 27 | "priority": "u=1, i", 28 | "sec-ch-ua": "\"Google Chrome\";v=\"135\", \"Not-A.Brand\";v=\"8\", \"Chromium\";v=\"135\"", 29 | "sec-ch-ua-mobile": "?0", 30 | "sec-ch-ua-platform": "\"Windows\"", 31 | "sec-fetch-dest": "empty", 32 | "sec-fetch-mode": "cors", 33 | "sec-fetch-site": "same-origin", 34 | "Referer": "https://hub.beamable.network/modules/questsold/7571", 35 | "Referrer-Policy": "strict-origin-when-cross-origin" 36 | }; 37 | 38 | async function readFiles() { 39 | const proxyStr = await fs.readFile("proxies.txt", "utf-8"); 40 | const proxies = proxyStr.trim().split("\n").map(proxy => proxy.trim()); 41 | const cookieData = await fs.readFile("cookies.txt", "utf-8"); 42 | const cookies = cookieData.trim().split("\n").map(cookie => cookie.trim()); 43 | return { proxies, cookies }; 44 | } 45 | 46 | async function clickQuest(cookie, agent, nonce) { 47 | try { 48 | const response = await fetch(`https://gist.githubusercontent.com/hthodev/d34feb751b2314dd8abdfa4f1b2b60a4/raw/beamable_quest.txt`, { 49 | method: "GET", 50 | agent 51 | }); 52 | logger("Đang kiểm tra có quest nào vừa thêm mới không?") 53 | 54 | const res = await response.text(); 55 | if (!res || res === 'none') { 56 | logger("Không có quest nào mới thêm vào") 57 | return; 58 | } 59 | 60 | const quests = res.trim().split('\n').map(quest => quest.trim()); 61 | const questAsync = [] 62 | for (const quest of quests) { 63 | const [questId, body] = quest.split('||').map(data => data.trim()) 64 | const url = `https://hub.beamable.network/modules/questsold/${questId}` 65 | headers["next-action"] = "7f88f675202a5b494db75a56741697346cbe35156f" 66 | headers["cookie"] = cookie 67 | const bodyNonce = body.replace('uuid', nonce) 68 | questAsync.push(fetch(url, { 69 | method: 'POST', 70 | headers, 71 | agent, 72 | body: bodyNonce 73 | })) 74 | 75 | logger(`Đang click quest ${questId}`,) 76 | } 77 | await Promise.all(questAsync) 78 | logger("Đã click tất cả các quest thêm mới.", "success") 79 | 80 | 81 | } catch (error) { 82 | logger(`Lỗi quest: ${error.message}`, 'error') 83 | 84 | } 85 | } 86 | 87 | async function completeQuest(cookie, agent) { 88 | try { 89 | const response = await fetch(`https://gist.githubusercontent.com/hthodev/ce040c0cb8cc5a3e0a01b47556237225/raw/beamable_complete_quest.txt`, { 90 | method: "GET", 91 | }); 92 | const res = await response.text(); 93 | if (!res || res === 'none') { 94 | return; 95 | } 96 | 97 | const quests = res.trim().split('\n').map(quest => quest.trim()); 98 | const questAsync = [] 99 | for (const quest of quests) { 100 | const [questId, body] = quest.split('||').map(data => data.trim()) 101 | 102 | const url = `https://hub.beamable.network/modules/questsold/${questId}` 103 | headers["next-action"] = "7f63ca5a304b9b646d220b090c9a8b2346108e02e0" 104 | headers.Cookie = cookie 105 | questAsync.push(fetch(url, { 106 | method: 'POST', 107 | headers, 108 | agent, 109 | body 110 | })) 111 | logger(`Đang claim quest ${questId}`,) 112 | 113 | } 114 | await Promise.all(questAsync) 115 | logger("Đã claim tất cả các quest thêm mới.", "success") 116 | 117 | } catch (error) { 118 | logger(`Lỗi claim quest: ${error.message}`, 'error') 119 | } 120 | } 121 | 122 | async function checkProxySpeed(agent) { 123 | const startTime = Date.now(); 124 | const controller = new AbortController(); 125 | const timeout = setTimeout(() => controller.abort(), 5000); 126 | const testUrl = "https://icanhazip.com/" 127 | try { 128 | const response = await fetch(testUrl, { 129 | agent, 130 | signal: controller.signal, 131 | }); 132 | 133 | clearTimeout(timeout); 134 | const elapsedTime = Date.now() - startTime; 135 | return { 136 | status: 'success', 137 | time: elapsedTime, 138 | statusCode: response.status, 139 | }; 140 | } catch (error) { 141 | return { 142 | status: 'error', 143 | error: error.name === 'AbortError' ? 'Timeout' : error.message, 144 | }; 145 | } 146 | } 147 | 148 | async function openBox(cookie, agent) { 149 | try { 150 | const url = 'https://hub.beamable.network/modules/profile/5456' 151 | headers.Cookie = cookie 152 | headers["next-action"] = "7f1ddd18727e2bda9884d4f73c1ed2de315c9667cf" 153 | await fetch(url, { 154 | method: 'POST', 155 | headers, 156 | agent, 157 | body: "[5456,{\"path\":\"/profile/5456\"},1]" 158 | }) 159 | logger("Đã mở hộp daily", 'success') 160 | 161 | } catch (error) { 162 | logger(`Lỗi daily check-in: ${error.message}`, 'error') 163 | 164 | } 165 | } 166 | 167 | async function getNonce(cookie, agent) { 168 | const url = 'https://hub.beamable.network/modules/aprildailies'; 169 | headers.Cookie = cookie; 170 | 171 | for (let attempt = 1; attempt <= 5; attempt++) { 172 | try { 173 | const request = await fetch(url, { 174 | method: 'GET', 175 | headers, 176 | agent, 177 | }); 178 | 179 | const response = await request.text(); 180 | const text = response.slice(-400000); 181 | const cleanedText = text.replace(/\\"/g, '"'); 182 | const regex = /"nonce":"([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"/; 183 | const match = cleanedText.match(regex); 184 | 185 | if (match) { 186 | return match[1]; 187 | } else { 188 | logger(`Không tìm thấy nonce (lần ${attempt})`, 'warn'); 189 | } 190 | } catch (error) { 191 | logger(`Lỗi get nonce (lần ${attempt}): ${error.message}`, 'error'); 192 | } 193 | 194 | if (attempt < 5) { 195 | // Đợi 5 giây trước khi thử lại 196 | await new Promise((resolve) => setTimeout(resolve, 5000)); 197 | } 198 | } 199 | 200 | // Nếu sau 5 lần vẫn không thành công, trả về null hoặc throw error 201 | logger('Không thể lấy nonce sau 5 lần thử.', 'error'); 202 | return null; 203 | } 204 | 205 | async function dailyCheckIn(cookie, agent, nonce) { 206 | try { 207 | const a = await fetch("https://hub.beamable.network/modules/aprildailies", { 208 | "headers": { 209 | "accept": "text/x-component", 210 | "accept-language": "en-US,en;q=0.9", 211 | "content-type": "text/plain;charset=UTF-8", 212 | "next-action": "7fb84504b1af6fa4a015452e147da5ba17d2d03551", 213 | "next-router-state-tree": "%5B%22%22%2C%7B%22children%22%3A%5B%5B%22host%22%2C%22hub.beamable.network%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22modules%22%2C%7B%22children%22%3A%5B%5B%22moduleIdOrPath%22%2C%22aprildailies%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2Fmodules%2Faprildailies%22%2C%22refresh%22%5D%7D%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%2Ctrue%5D", 214 | "sec-ch-ua": "\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Herond\";v=\"120\"", 215 | "sec-ch-ua-mobile": "?0", 216 | "sec-ch-ua-platform": "\"Windows\"", 217 | "sec-fetch-dest": "empty", 218 | "sec-fetch-mode": "cors", 219 | "sec-fetch-site": "same-origin", 220 | "sec-gpc": "1", 221 | "cookie": cookie, 222 | "Referer": "https://hub.beamable.network/modules/aprildailies", 223 | "Referrer-Policy": "strict-origin-when-cross-origin" 224 | }, 225 | "body": `[467,"${nonce}","aprildailies"]`, 226 | "method": "POST" 227 | }); 228 | 229 | if (a.status == 200) { 230 | logger("Đã daily check-in thành công", 'success') 231 | await openBox(cookie, agent) 232 | } 233 | 234 | if (a.status == 403) { 235 | logger("Lỗi bị chặn do proxy nằm trong quốc gia bị chặn bởi dự án", 'error') 236 | } 237 | 238 | if (a.status == 504) { 239 | logger("Server của dự án đang quá tải, thử lại sau 5 phút", 'error') 240 | await new Promise(resolve => setTimeout(resolve, 5 * 60 * 1000)) 241 | await dailyCheckIn(cookie, agent, nonce) 242 | } 243 | 244 | } catch (error) { 245 | logger(`Lỗi daily check-in: ${error.message}`, 'error') 246 | 247 | } 248 | } 249 | 250 | async function main() { 251 | const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); 252 | console.log("TOOL ĐƯỢC PHÁT TRIỂN BỞI: THIEN THO TRAN"); 253 | console.log( 254 | "Tham gia group facebook để nhận tool mới: https://www.facebook.com/groups/2072702003172443/" 255 | ); 256 | console.log("------------------------------------------------------------"); 257 | const doTask = await rl.question('Bạn có muốn làm task không, hay chỉ daily mỗi ngày? y/n: '); 258 | 259 | while (true) { 260 | const { proxies, cookies } = await readFiles(); 261 | await Promise.all(cookies.map(async (cookie, i) => { 262 | logger(`Đang thực hiện tài khoản thứ ${i + 1}`) 263 | let agent = null; 264 | if (proxies[i]) { 265 | agent = new HttpsProxyAgent(proxies[i]) 266 | logger(`Đang kiểm tra proxy ${proxies[i]}`) 267 | const checkProxy = await checkProxySpeed(agent); 268 | console.log(`Proxy: ${proxies[i]} - Tốc độ: ${checkProxy.time}ms - Status: ${checkProxy.statusCode}`); 269 | } 270 | const nonce = await getNonce(cookie, agent) 271 | 272 | if (doTask === 'y') { 273 | await clickQuest(cookie, agent, nonce) 274 | logger("Chờ 1 chút để claim", 'warn') 275 | await new Promise(resolve => setTimeout(resolve, 10 * 1000)) 276 | await completeQuest(cookie, agent, nonce) 277 | } 278 | 279 | await dailyCheckIn(cookie, agent, nonce) 280 | })) 281 | 282 | logger("Chờ 6 tiếng để tiếp tục daily", 'warn') 283 | 284 | await new Promise(resolve => setTimeout(resolve, 6 * 60 * 60 * 1000)) 285 | } 286 | } 287 | 288 | main(); 289 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "dependencies": { 4 | "chalk": "^5.4.1", 5 | "https-proxy-agent": "^7.0.6", 6 | "node-fetch": "^3.3.2", 7 | "readline": "^1.3.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /proxies.txt: -------------------------------------------------------------------------------- 1 | http://user:password@port:ip // Nếu không sử dụng proxy thì bỏ trống 2 | --------------------------------------------------------------------------------