├── proxy.txt ├── image.png ├── image-1.png ├── package.json ├── README.md └── main.js /proxy.txt: -------------------------------------------------------------------------------- 1 | http://ip:port -------------------------------------------------------------------------------- /image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zlkcyber/aigaea-bot/HEAD/image.png -------------------------------------------------------------------------------- /image-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zlkcyber/aigaea-bot/HEAD/image-1.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aigea-bot-proxy", 3 | "version": "1.0.0", 4 | "description": "A script to handle proxies, authentication, and pinging with unique browser IDs.", 5 | "main": "main.js", 6 | "scripts": { 7 | "start": "node main.js" 8 | }, 9 | "dependencies": { 10 | "node-fetch": "^3.3.0", 11 | "https-proxy-agent": "^5.0.0", 12 | "readline": "^1.3.0" 13 | }, 14 | "engines": { 15 | "node": ">=16.0.0" 16 | }, 17 | "author": "@Zlkcyber", 18 | "license": "ISC", 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/Zlkcyber/aigaea-bot.git" 22 | }, 23 | "keywords": [ 24 | "aigea", 25 | "proxy", 26 | "https://app.aigaea.net/" 27 | ], 28 | "bugs": { 29 | "url": "https://github.com/Zlkcyber/aigaea-bot/issues" 30 | }, 31 | "homepage": "https://github.com/Zlkcyber/aigaea-bot#readme" 32 | } 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## AIGEA BOT USING PROXY [https://app.aigaea.net/](https://app.aigaea.net/register?ref=gamBazFEV0g4kt) 2 | 3 | ![banner](image.png) 4 | 5 | # Proxy Manager with Aigaea 6 | 7 | This is a proxy manager script that interacts with Aigaea's API, allowing you to authenticate with proxies, track scores, and manage browser sessions. The script fetches proxy lists and pings them periodically while managing authentication sessions. 8 | 9 | ## Requirements 10 | 11 | - Node.js (v16 or above) 12 | - npm (Node Package Manager) 13 | - Aigaea account (for obtaining the access token) 14 | 15 | ## Installation 16 | 17 | 1. **Clone the repository or download the script**: 18 | 19 | ```bash 20 | git clone https://github.com/Zlkcyber/aigaea-bot.git 21 | cd aigea-bot 22 | ``` 23 | 24 | 2. **Install dependencies**: 25 | 26 | The script requires several packages such as `node-fetch`, `https-proxy-agent`, and `readline`. You can install these by running: 27 | 28 | ```bash 29 | npm install 30 | ``` 31 | 32 | The necessary packages will be listed in `package.json`. 33 | 34 | 3. **Create the `proxy.txt` file**: 35 | 36 | The proxy list will be saved to this file, put your proxy there. 37 | 38 | 39 | ## Access Token and first 8 browserID 40 | - You can obtain your token and browser id from the [Aigaea Dashboard](https://app.aigaea.net/register?ref=gamBazFEV0g4kt). 41 | 42 | ![gaea-token](image-1.png) 43 | - Copy your first 8 browser id 44 | - 45 | ![image](https://github.com/user-attachments/assets/15f23b20-951a-4963-91f3-2277b9db1b26) 46 | 47 | 48 | ## Running the Script 49 | 50 | 1. **Run the script**: 51 | 52 | After installing the dependencies and setting up the `proxy.txt` file, you can run the script using Node.js: 53 | 54 | ```bash 55 | npm run start 56 | ``` 57 | 58 | 59 | ## How It Works 60 | 61 | **Proxy Authentication and Pinging**: 62 | - The script authenticates with Aigaea using your access token. 63 | - It retrieves a `browser_id` for each proxy, which is stored for future use. 64 | - Periodically, the script pings the proxies to ensure they are still functional and have a high score. 65 | - If a proxy's score falls below a certain threshold, it will re-authenticate and retry the ping process. 66 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | (async () => { 2 | const fetch = (await import('node-fetch')).default; 3 | const fs = require('fs').promises; 4 | const { HttpsProxyAgent } = require('https-proxy-agent'); 5 | const path = require('path'); 6 | const readline = require('readline'); 7 | const crypto = require('crypto'); 8 | 9 | const rl = readline.createInterface({ 10 | input: process.stdin, 11 | output: process.stdout 12 | }); 13 | 14 | function askQuestion(query) { 15 | return new Promise((resolve) => rl.question(query, (answer) => resolve(answer))); 16 | } 17 | 18 | async function main() { 19 | const accessToken = await askQuestion("Enter your accessToken :"); 20 | const id8 = await askQuestion("Enter your first 8 browserID :"); 21 | 22 | let headers = { 23 | 'Accept': 'application/json, text/plain, */*', 24 | 'origin': 'chrome-extension://cpjicfogbgognnifjgmenmaldnmeeeib', 25 | 'Content-Type': 'application/json', 26 | 'Authorization': `Bearer ${accessToken}`, 27 | 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" 28 | }; 29 | 30 | const browserIdFilePath = path.join(__dirname, 'browser_ids.json'); 31 | 32 | async function coday(url, method, payloadData = null, proxy) { 33 | try { 34 | const agent = new HttpsProxyAgent(proxy); 35 | let response; 36 | const options = { 37 | method: method, 38 | headers: headers, 39 | agent: agent 40 | }; 41 | 42 | if (method === 'POST') { 43 | options.body = JSON.stringify(payloadData); 44 | response = await fetch(url, options); 45 | } else { 46 | response = await fetch(url, options); 47 | } 48 | 49 | return await response.json(); 50 | } catch (error) { 51 | console.error('Error with proxy:', proxy); 52 | } 53 | } 54 | 55 | function generateBrowserId() { 56 | const rdm = crypto.randomUUID().slice(8); 57 | const browserId = `${id8}${rdm}` 58 | return browserId; 59 | } 60 | 61 | async function loadBrowserIds() { 62 | try { 63 | const data = await fs.readFile(browserIdFilePath, 'utf-8'); 64 | return JSON.parse(data); 65 | } catch (error) { 66 | return {}; 67 | } 68 | } 69 | 70 | async function saveBrowserIds(browserIds) { 71 | try { 72 | await fs.writeFile(browserIdFilePath, JSON.stringify(browserIds, null, 2), 'utf-8'); 73 | console.log('Browser IDs saved to file.'); 74 | } catch (error) { 75 | console.error('Error saving browser IDs:', error); 76 | } 77 | } 78 | 79 | async function getBrowserId(proxy) { 80 | const browserIds = await loadBrowserIds(); 81 | if (browserIds[proxy]) { 82 | console.log(`Using existing browser_id for proxy ${proxy}`); 83 | return browserIds[proxy]; 84 | } else { 85 | const newBrowserId = generateBrowserId(); 86 | browserIds[proxy] = newBrowserId; // Save new browser_id for the proxy 87 | await saveBrowserIds(browserIds); 88 | console.log(`Generated new browser_id for proxy ${proxy}: ${newBrowserId}`); 89 | return newBrowserId; 90 | } 91 | } 92 | 93 | function getCurrentTimestamp() { 94 | return Math.floor(Date.now() / 1000); 95 | } 96 | 97 | async function pingProxy(proxy, browser_id, uid) { 98 | const timestamp = getCurrentTimestamp(); 99 | const pingPayload = { "uid": uid, "browser_id": browser_id, "timestamp": timestamp, "version": "1.0.1" }; 100 | 101 | while (true) { 102 | try { 103 | const pingResponse = await coday('https://api.aigaea.net/api/network/ping', 'POST', pingPayload, proxy); 104 | await coday('https://api.aigaea.net/api/network/ip', 'GET', {}, proxy) 105 | console.log(`Ping successful for proxy ${proxy}:`, pingResponse); 106 | 107 | // Check the score 108 | if (pingResponse.data && pingResponse.data.score < 50) { 109 | console.log(`Score below 50 for proxy ${proxy}, re-authenticating...`); 110 | 111 | // Re-authenticate and restart pinging with a new browser_id 112 | await handleAuthAndPing(proxy); 113 | break; 114 | } 115 | } catch (error) { 116 | console.error(`Ping failed for proxy ${proxy}:`, error); 117 | } 118 | await new Promise(resolve => setTimeout(resolve, 600000)); // Wait 10 minutes before the next ping 119 | } 120 | } 121 | 122 | async function handleAuthAndPing(proxy) { 123 | const payload = {}; 124 | const authResponse = await coday("https://api.aigaea.net/api/auth/session", 'POST', payload, proxy); 125 | 126 | if (authResponse && authResponse.data) { 127 | const uid = authResponse.data.uid; 128 | const browser_id = await getBrowserId(proxy); // Get or generate a unique browser_id for this proxy 129 | console.log(`Authenticated for proxy ${proxy} with uid ${uid} and browser_id ${browser_id}`); 130 | 131 | // Start pinging 132 | pingProxy(proxy, browser_id, uid); 133 | } else { 134 | console.error(`Authentication failed for proxy ${proxy}`); 135 | } 136 | } 137 | 138 | try { 139 | // Read proxies from proxy.txt 140 | const proxyList = await fs.readFile('proxy.txt', 'utf-8'); 141 | const proxies = proxyList.split('\n').map(proxy => proxy.trim()).filter(proxy => proxy); 142 | 143 | if (proxies.length === 0) { 144 | console.error("No proxies found in proxy.txt"); 145 | return; 146 | } 147 | 148 | const tasks = proxies.map(proxy => handleAuthAndPing(proxy)); 149 | 150 | await Promise.all(tasks); 151 | 152 | } catch (error) { 153 | console.error('An error occurred:', error); 154 | } 155 | } 156 | 157 | main(); 158 | })(); 159 | --------------------------------------------------------------------------------