├── run.bat
├── proxies.txt
├── install.bat
├── .github
├── FUNDING.yml
└── workflows
│ └── codeql.yml
├── requirements.txt
├── .gitignore
├── LICENSE
├── README.md
├── captcha_patterns.py
├── advanced_captcha_solver.py
└── generator.py
/run.bat:
--------------------------------------------------------------------------------
1 | python generator.py
--------------------------------------------------------------------------------
/proxies.txt:
--------------------------------------------------------------------------------
1 | Place your proxies here
2 |
--------------------------------------------------------------------------------
/install.bat:
--------------------------------------------------------------------------------
1 | pip install -r requirements.txt
2 | PAUSE
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: Dorukuz # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | requests>=2.31.0
2 | colorama>=0.4.6
3 | cursor>=1.3.5
4 | rich>=13.5.2
5 | python-dotenv>=1.0.0
6 | selenium>=4.15.0
7 | undetected-chromedriver>=3.5.3
8 | setuptools>=69.0.0
9 | opencv-python>=4.7.0
10 | numpy>=1.24.0
11 | pillow>=11.2.1
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Python bytecode
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # Distribution / packaging
7 | dist/
8 | build/
9 | *.egg-info/
10 |
11 | # Virtual environments
12 | venv/
13 | env/
14 | ENV/
15 |
16 | # Downloaded models
17 | /models/*.weights
18 | /models/*.cfg
19 |
20 | # Generated files
21 | tokens.txt
22 | accounts.txt
23 | proxies.txt
24 |
25 | # Environment variables
26 | .env
27 |
28 | # Temporary files
29 | *.log
30 | *.bak
31 |
32 | # IDE configs
33 | .vscode/
34 | .idea/
35 | *.swp
36 |
37 | # Windows specific
38 | Thumbs.db
39 | Desktop.ini
40 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 Dorukuz
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Discord Token Generator 2.0 with AI Solver
4 |
5 | Powerful token generator with AI-powered captcha solving
6 |
7 |
8 |
9 | Buy me a coffe maybe? LTC Wallet : ltc1qv9fltuf43re825q90kelm2tfym42sdp728v897
10 |
11 |
12 | ## ✨ Features
13 |
14 | - **AI Captcha Solver** - Automatically solves hCaptcha without external services
15 | - **Proxy Integration** - Auto-fetches and rotates fresh proxies
16 | - **Modern UI** - Clean console interface with status updates
17 | - **Smart Retries** - Intelligent error handling and connection recovery
18 | - **Zero API Costs** - No need for paid captcha solving services
19 |
20 | ## ⚙️ Installation
21 |
22 | ```bash
23 | # Clone the repository
24 | git clone https://github.com/Dorukuz/Discord-Token-Generator.git
25 |
26 | # Navigate to the directory
27 | cd Discord-Token-Generator
28 |
29 | # Install requirements
30 | pip install -r requirements.txt
31 |
32 | # Run the generator
33 | python generator.py
34 | ```
35 |
36 | ## 🚀 Usage
37 |
38 | 1. Run the generator: `python generator.py`
39 | 2. The tool will automatically fetch free proxies or you can input your proxies to proxies.txt file
40 | 3. Select option 1 to generate tokens
41 | 4. Enter the number of tokens you want to create
42 | 5. Let the AI handle captchas automatically
43 | 6. Check `tokens.txt` for your generated tokens
44 |
45 |
46 | ## 🔧 How It Works
47 |
48 | This generator uses multiple AI techniques to solve captchas:
49 |
50 | 1. **Pattern Recognition** - Identifies common hCaptcha patterns
51 | 2. **Object Detection** - Uses YOLO to detect objects in captcha images
52 | 3. **Text Analysis** - Extracts target objects from captcha instructions
53 | 4. **Browser Automation** - Mimics human behavior to avoid detection
54 |
55 | ## ⚠️ Disclaimer
56 |
57 | This tool is for educational purposes only. Use responsibly and in accordance with Discord's Terms of Service.
58 |
59 | ## 📝 License
60 |
61 | MIT License
62 |
63 | ---
64 |
65 |
66 |
Developed with ❤️ by Dorukuz
67 |
For business inquiries: Telegram
68 |
69 |
--------------------------------------------------------------------------------
/captcha_patterns.py:
--------------------------------------------------------------------------------
1 | import cv2
2 | import numpy as np
3 |
4 | class PatternMatcher:
5 | @staticmethod
6 | def get_patterns():
7 | """Return common hCaptcha image patterns"""
8 | return {
9 | 'airplane': [
10 | ([200, 200, 200], [255, 255, 255]), # Sky color range
11 | ([100, 100, 100], [150, 150, 150]) # Aircraft body range
12 | ],
13 | 'bicycle': [
14 | ([50, 50, 50], [100, 100, 100]), # Wheel/frame color range
15 | ([150, 150, 150], [200, 200, 200]) # Background range
16 | ],
17 | 'boat': [
18 | ([0, 100, 200], [100, 200, 255]), # Water color range
19 | ([200, 200, 200], [255, 255, 255]) # Boat color range
20 | ],
21 | 'bus': [
22 | ([200, 50, 50], [255, 100, 100]), # Red bus color range
23 | ([50, 50, 200], [100, 100, 255]) # Blue bus color range
24 | ],
25 | 'car': [
26 | ([50, 50, 50], [150, 150, 150]), # Car body range
27 | ([200, 200, 200], [255, 255, 255]) # Road/background range
28 | ],
29 | 'motorcycle': [
30 | ([0, 0, 0], [50, 50, 50]), # Dark parts range
31 | ([200, 200, 200], [255, 255, 255]) # Chrome/metal range
32 | ],
33 | 'train': [
34 | ([50, 50, 50], [100, 100, 100]), # Train body range
35 | ([150, 150, 150], [200, 200, 200]) # Track/background range
36 | ],
37 | 'truck': [
38 | ([100, 100, 100], [150, 150, 150]), # Truck body range
39 | ([200, 200, 200], [255, 255, 255]) # Background range
40 | ]
41 | }
42 |
43 | @staticmethod
44 | def match_pattern(image, pattern_ranges):
45 | """Match image against a specific pattern's color ranges"""
46 | matches = 0
47 | for lower, upper in pattern_ranges:
48 | mask = cv2.inRange(image, np.array(lower), np.array(upper))
49 | if np.sum(mask) > 1000: # Threshold for considering a match
50 | matches += 1
51 | return matches >= len(pattern_ranges) * 0.5 # 50% of ranges must match
52 |
53 | def analyze_image(self, image):
54 | """Analyze image and return best matching pattern"""
55 | patterns = self.get_patterns()
56 | best_match = None
57 | highest_confidence = 0
58 |
59 | for pattern_name, pattern_ranges in patterns.items():
60 | if self.match_pattern(image, pattern_ranges):
61 | confidence = 0.8 # Base confidence for pattern match
62 | if confidence > highest_confidence:
63 | highest_confidence = confidence
64 | best_match = pattern_name
65 |
66 | return best_match, highest_confidence
67 |
--------------------------------------------------------------------------------
/.github/workflows/codeql.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ "main" ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ "main" ]
20 | schedule:
21 | - cron: '26 7 * * 2'
22 |
23 | jobs:
24 | analyze:
25 | name: Analyze
26 | runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
27 | timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
28 | permissions:
29 | actions: read
30 | contents: read
31 | security-events: write
32 |
33 | strategy:
34 | fail-fast: false
35 | matrix:
36 | language: [ 'python' ]
37 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
38 | # Use only 'java' to analyze code written in Java, Kotlin or both
39 | # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
40 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41 |
42 | steps:
43 | - name: Checkout repository
44 | uses: actions/checkout@v3
45 |
46 | # Initializes the CodeQL tools for scanning.
47 | - name: Initialize CodeQL
48 | uses: github/codeql-action/init@v2
49 | with:
50 | languages: ${{ matrix.language }}
51 | # If you wish to specify custom queries, you can do so here or in a config file.
52 | # By default, queries listed here will override any specified in a config file.
53 | # Prefix the list here with "+" to use these queries and those in the config file.
54 |
55 | # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
56 | # queries: security-extended,security-and-quality
57 |
58 |
59 | # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
60 | # If this step fails, then you should remove it and run the build manually (see below)
61 | - name: Autobuild
62 | uses: github/codeql-action/autobuild@v2
63 |
64 | # ℹ️ Command-line programs to run using the OS shell.
65 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
66 |
67 | # If the Autobuild fails above, remove it and uncomment the following three lines.
68 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
69 |
70 | # - run: |
71 | # echo "Run, Build Application using script"
72 | # ./location_of_script_within_repo/buildscript.sh
73 |
74 | - name: Perform CodeQL Analysis
75 | uses: github/codeql-action/analyze@v2
76 | with:
77 | category: "/language:${{matrix.language}}"
78 |
--------------------------------------------------------------------------------
/advanced_captcha_solver.py:
--------------------------------------------------------------------------------
1 | import os
2 | import time
3 | import base64
4 | import json
5 | import random
6 | import requests
7 | import numpy as np
8 | import cv2
9 | from PIL import Image
10 | import io
11 | from typing import Tuple, List, Dict, Any, Optional
12 | from captcha_patterns import PatternMatcher
13 | from selenium import webdriver
14 | import undetected_chromedriver as uc
15 | from selenium.webdriver.common.by import By
16 | from selenium.webdriver.support.ui import WebDriverWait
17 | from selenium.webdriver.support import expected_conditions as EC
18 | from rich.console import Console
19 |
20 | console = Console()
21 |
22 | class AdvancedCaptchaSolver:
23 | def __init__(self):
24 | # Initialize all available solvers
25 | self.pattern_matcher = self._load_pattern_matcher()
26 | self.browser = None
27 | self.yolo_model = self._load_yolo_model()
28 | self.object_classes = self._load_object_classes()
29 | self.captcha_types = {
30 | "select_all_matching": ["Please select all", "Select all", "Choose all"],
31 | "select_specific": ["Please select", "Click on", "Choose the"],
32 | "verify_human": ["I'm not a robot", "I am human"]
33 | }
34 |
35 | def _load_pattern_matcher(self):
36 | """Initialize the basic pattern matcher"""
37 | try:
38 | pattern_matcher = PatternMatcher()
39 | console.print("[green]Successfully initialized pattern matcher[/green]")
40 | return pattern_matcher
41 | except Exception as e:
42 | console.print(f"[red]Error initializing pattern matcher: {str(e)}[/red]")
43 | return None
44 |
45 | def _load_yolo_model(self):
46 | """Load YOLO model for object detection if available"""
47 | try:
48 | # Check if we have OpenCV DNN
49 | has_dnn = hasattr(cv2, 'dnn')
50 | model_path = os.path.join(os.path.dirname(__file__), 'models')
51 |
52 | if has_dnn and os.path.exists(os.path.join(model_path, 'yolov3.weights')):
53 | # Load YOLOv3
54 | net = cv2.dnn.readNetFromDarknet(
55 | os.path.join(model_path, 'yolov3.cfg'),
56 | os.path.join(model_path, 'yolov3.weights')
57 | )
58 | console.print("[green]Successfully loaded YOLO model[/green]")
59 | return net
60 | else:
61 | # Download compact YOLOv3 if it doesn't exist
62 | if not os.path.exists(model_path):
63 | os.makedirs(model_path)
64 |
65 | if not os.path.exists(os.path.join(model_path, 'yolov3-tiny.weights')):
66 | console.print("[yellow]Downloading compact YOLO model...[/yellow]")
67 | try:
68 | os.system(f"curl -o {os.path.join(model_path, 'yolov3-tiny.weights')} https://pjreddie.com/media/files/yolov3-tiny.weights")
69 | os.system(f"curl -o {os.path.join(model_path, 'yolov3-tiny.cfg')} https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3-tiny.cfg")
70 | except:
71 | console.print("[yellow]Failed to download YOLO model, will use pattern matching only[/yellow]")
72 | return None
73 |
74 | if os.path.exists(os.path.join(model_path, 'yolov3-tiny.weights')):
75 | net = cv2.dnn.readNetFromDarknet(
76 | os.path.join(model_path, 'yolov3-tiny.cfg'),
77 | os.path.join(model_path, 'yolov3-tiny.weights')
78 | )
79 | console.print("[green]Successfully loaded compact YOLO model[/green]")
80 | return net
81 | except Exception as e:
82 | console.print(f"[yellow]Error loading YOLO model: {str(e)}. Will use pattern matching only.[/yellow]")
83 |
84 | return None
85 |
86 | def _load_object_classes(self):
87 | """Load object class names for models"""
88 | coco_classes = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat',
89 | 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat',
90 | 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack',
91 | 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball',
92 | 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
93 | 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
94 | 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair',
95 | 'couch', 'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse',
96 | 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink', 'refrigerator',
97 | 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush']
98 |
99 | # Common hCaptcha classes
100 | hcaptcha_classes = {
101 | 'airplanes': ['airplane', 'aircraft', 'jet', 'plane'],
102 | 'bicycles': ['bicycle', 'bike', 'cycling'],
103 | 'boats': ['boat', 'ship', 'sailboat', 'watercraft'],
104 | 'buses': ['bus', 'coach', 'autobus'],
105 | 'cars': ['car', 'automobile', 'vehicle'],
106 | 'motorcycles': ['motorcycle', 'motorbike', 'scooter'],
107 | 'trains': ['train', 'locomotive', 'subway', 'metro'],
108 | 'trucks': ['truck', 'lorry', 'pickup'],
109 | 'animals': ['cat', 'dog', 'bird', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe'],
110 | 'bridges': ['bridge', 'overpass', 'viaduct'],
111 | 'chimneys': ['chimney', 'smokestack'],
112 | 'crosswalks': ['crosswalk', 'zebra crossing', 'pedestrian crossing'],
113 | 'fire hydrants': ['fire hydrant', 'hydrant'],
114 | 'palm trees': ['palm tree', 'palm', 'coconut tree'],
115 | 'parking meters': ['parking meter', 'meter'],
116 | 'stairs': ['stairs', 'staircase', 'steps'],
117 | 'stop signs': ['stop sign'],
118 | 'traffic lights': ['traffic light', 'stoplight', 'signal']
119 | }
120 |
121 | return {
122 | 'coco': coco_classes,
123 | 'hcaptcha': hcaptcha_classes
124 | }
125 |
126 | def _preprocess_image(self, image_data):
127 | """Preprocess image for analysis"""
128 | try:
129 | # Convert base64 to image
130 | if isinstance(image_data, str) and image_data.startswith('data:image'):
131 | image_data = base64.b64decode(image_data.split(',')[1])
132 |
133 | # Convert to numpy array
134 | nparr = np.frombuffer(image_data, np.uint8)
135 | img = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
136 |
137 | if img is None:
138 | console.print("[red]Failed to decode image[/red]")
139 | return None
140 |
141 | return img
142 | except Exception as e:
143 | console.print(f"[red]Error preprocessing image: {str(e)}[/red]")
144 | return None
145 |
146 | def _initialize_browser(self):
147 | """Initialize undetected Chrome browser"""
148 | try:
149 | options = webdriver.ChromeOptions()
150 | options.add_argument('--headless')
151 | options.add_argument('--no-sandbox')
152 | options.add_argument('--disable-dev-shm-usage')
153 | self.browser = uc.Chrome(options=options)
154 | console.print("[green]Browser initialized successfully[/green]")
155 | except Exception as e:
156 | console.print(f"[red]Error initializing browser: {str(e)}[/red]")
157 |
158 | def analyze_image_with_pattern_matcher(self, image):
159 | """Use pattern matching to analyze image"""
160 | results = {}
161 | if self.pattern_matcher:
162 | patterns = self.pattern_matcher.get_patterns()
163 | for name, pattern_ranges in patterns.items():
164 | if self.pattern_matcher.match_pattern(image, pattern_ranges):
165 | results[name] = 0.7 # Standard confidence for pattern matches
166 |
167 | # Return the best match and confidence
168 | if results:
169 | best_match = max(results.items(), key=lambda x: x[1])
170 | return best_match[0], best_match[1]
171 | return None, 0.0
172 |
173 | def analyze_image_with_yolo(self, image):
174 | """Use YOLO model for object detection"""
175 | if self.yolo_model is None:
176 | return None, 0.0
177 |
178 | try:
179 | height, width = image.shape[:2]
180 |
181 | # Prepare image for YOLO
182 | blob = cv2.dnn.blobFromImage(image, 1/255.0, (416, 416), swapRB=True, crop=False)
183 | self.yolo_model.setInput(blob)
184 |
185 | # Get output layer names
186 | layer_names = self.yolo_model.getLayerNames()
187 | output_layers = [layer_names[i - 1] for i in self.yolo_model.getUnconnectedOutLayers()]
188 |
189 | # Run forward pass
190 | outputs = self.yolo_model.forward(output_layers)
191 |
192 | # Process outputs
193 | class_ids = []
194 | confidences = []
195 |
196 | for output in outputs:
197 | for detection in output:
198 | scores = detection[5:]
199 | class_id = np.argmax(scores)
200 | confidence = scores[class_id]
201 |
202 | if confidence > 0.5: # Confidence threshold
203 | class_ids.append(class_id)
204 | confidences.append(float(confidence))
205 |
206 | # Get the most confident detection
207 | if confidences:
208 | max_conf_index = np.argmax(confidences)
209 | class_name = self.object_classes['coco'][class_ids[max_conf_index]]
210 | confidence = confidences[max_conf_index]
211 |
212 | # Map to hCaptcha classes
213 | for hcaptcha_class, aliases in self.object_classes['hcaptcha'].items():
214 | if class_name in aliases:
215 | return hcaptcha_class, confidence
216 |
217 | return class_name, confidence
218 |
219 | except Exception as e:
220 | console.print(f"[yellow]Error in YOLO analysis: {str(e)}[/yellow]")
221 |
222 | return None, 0.0
223 |
224 | # Cloud Vision functionality removed - not needed for core functionality
225 |
226 | def analyze_image(self, image):
227 | """Analyze image using multiple methods and return the most confident result"""
228 | results = []
229 |
230 | # Method 1: Pattern matching
231 | pattern_class, pattern_conf = self.analyze_image_with_pattern_matcher(image)
232 | if pattern_class:
233 | results.append((pattern_class, pattern_conf, "pattern"))
234 |
235 | # Method 2: YOLO
236 | yolo_class, yolo_conf = self.analyze_image_with_yolo(image)
237 | if yolo_class:
238 | results.append((yolo_class, yolo_conf, "yolo"))
239 |
240 | # Method 3: Cloud Vision support removed for simplification
241 |
242 | # Return the most confident result
243 | if results:
244 | results.sort(key=lambda x: x[1], reverse=True)
245 | console.print(f"[green]Best match: {results[0][0]} (Confidence: {results[0][1]:.2f}, Method: {results[0][2]})[/green]")
246 | return results[0][0], results[0][1]
247 |
248 | return None, 0.0
249 |
250 | def extract_captcha_type(self, captcha_text):
251 | """Extract the type of captcha from text"""
252 | captcha_text = captcha_text.lower()
253 |
254 | for captcha_type, patterns in self.captcha_types.items():
255 | if any(pattern.lower() in captcha_text for pattern in patterns):
256 | return captcha_type
257 |
258 | return "unknown"
259 |
260 | def extract_target_object(self, captcha_text):
261 | """Extract the target object from captcha text"""
262 | captcha_text = captcha_text.lower()
263 |
264 | # For specific selection captchas
265 | for hcaptcha_class in self.object_classes['hcaptcha'].keys():
266 | # Check singular form
267 | if hcaptcha_class.lower() in captcha_text:
268 | return hcaptcha_class
269 | # Check plural form by removing 's' if it exists
270 | if hcaptcha_class.lower().endswith('s') and hcaptcha_class[:-1].lower() in captcha_text:
271 | return hcaptcha_class
272 |
273 | # For general object detection
274 | for hcaptcha_class, aliases in self.object_classes['hcaptcha'].items():
275 | for alias in aliases:
276 | if alias.lower() in captcha_text:
277 | return hcaptcha_class
278 |
279 | return None
280 |
281 | def solve_captcha(self, site_key: str, site_url: str) -> Optional[str]:
282 | """Solve hCaptcha challenge and return the token"""
283 | try:
284 | console.print("[cyan]Initializing advanced AI captcha solver...[/cyan]")
285 |
286 | # Initialize browser if not already done
287 | if not self.browser:
288 | self._initialize_browser()
289 | if not self.browser:
290 | return None
291 |
292 | # Navigate to hCaptcha
293 | self.browser.get(f"https://newassets.hcaptcha.com/captcha/v1/d11c9f2/static/hcaptcha-challenge.html#{site_key}")
294 | console.print("[cyan]Navigating to hCaptcha challenge...[/cyan]")
295 |
296 | # Wait for the challenge to load
297 | WebDriverWait(self.browser, 10).until(
298 | EC.presence_of_element_located((By.CSS_SELECTOR, ".challenge-container"))
299 | )
300 | console.print("[cyan]Challenge loaded, analyzing...[/cyan]")
301 |
302 | # Get the challenge text
303 | try:
304 | challenge_text = self.browser.find_element(By.CSS_SELECTOR, ".prompt-text").text
305 | console.print(f"[cyan]Challenge text: {challenge_text}[/cyan]")
306 |
307 | # Determine captcha type and target object
308 | captcha_type = self.extract_captcha_type(challenge_text)
309 | target_object = self.extract_target_object(challenge_text)
310 |
311 | console.print(f"[cyan]Detected captcha type: {captcha_type}, Target: {target_object}[/cyan]")
312 | except:
313 | console.print("[yellow]Could not find challenge text, using general solver[/yellow]")
314 | captcha_type = "unknown"
315 | target_object = None
316 |
317 | # Find all image elements
318 | img_elements = self.browser.find_elements(By.CSS_SELECTOR, ".task-image .image")
319 | if not img_elements:
320 | console.print("[yellow]No images found in the challenge[/yellow]")
321 | return None
322 |
323 | console.print(f"[cyan]Found {len(img_elements)} images to analyze[/cyan]")
324 |
325 | # Simple "I'm not a robot" verification
326 | if captcha_type == "verify_human":
327 | verify_btn = self.browser.find_element(By.CSS_SELECTOR, "#checkbox")
328 | verify_btn.click()
329 | time.sleep(2)
330 |
331 | # Get the hCaptcha token
332 | token = self.browser.execute_script("return document.getElementById('h-captcha-response').value")
333 | if token:
334 | console.print("[green]Successfully solved 'I'm not a robot' challenge[/green]")
335 | return token
336 |
337 | # Process each image for selection captchas
338 | for i, img in enumerate(img_elements):
339 | try:
340 | # Extract image data
341 | img_style = img.get_attribute("style")
342 | img_url = img_style.split('url("')[1].split('")')[0]
343 |
344 | # Download the image
345 | img_response = self.browser.execute_script(f"return fetch('{img_url}').then(r => r.blob()).then(blob => new Promise((resolve, reject) => {{const reader = new FileReader(); reader.onloadend = () => resolve(reader.result); reader.onerror = reject; reader.readAsDataURL(blob);}}))")
346 |
347 | # Process the image
348 | processed_img = self._preprocess_image(img_response)
349 |
350 | if processed_img is not None:
351 | # Analyze image
352 | detected_class, confidence = self.analyze_image(processed_img)
353 |
354 | # Click on images that match the target class
355 | if detected_class and target_object:
356 | if (detected_class.lower() == target_object.lower() or
357 | detected_class.lower() in self.object_classes['hcaptcha'].get(target_object.lower(), [])):
358 | console.print(f"[green]Image {i+1}: Found match for {target_object} (Confidence: {confidence:.2f})[/green]")
359 | img.click()
360 | time.sleep(0.5)
361 | # If we don't have a target, click on any image with high confidence
362 | elif detected_class and confidence > 0.7:
363 | console.print(f"[green]Image {i+1}: Found {detected_class} (Confidence: {confidence:.2f})[/green]")
364 | img.click()
365 | time.sleep(0.5)
366 |
367 | except Exception as e:
368 | console.print(f"[yellow]Error processing image {i+1}: {str(e)}[/yellow]")
369 |
370 | # Submit the challenge
371 | submit_button = self.browser.find_element(By.CSS_SELECTOR, ".button-submit")
372 | submit_button.click()
373 | time.sleep(2)
374 |
375 | # Check if we need to solve more challenges
376 | try:
377 | new_challenge = self.browser.find_element(By.CSS_SELECTOR, ".challenge-container")
378 | console.print("[cyan]Additional challenge detected, solving...[/cyan]")
379 | return self.solve_captcha(site_key, site_url) # Recursively solve new challenge
380 | except:
381 | pass
382 |
383 | # Get the hCaptcha token
384 | token = self.browser.execute_script("return document.getElementById('h-captcha-response').value")
385 | if token:
386 | console.print("[green]Successfully solved captcha challenge![/green]")
387 | return token
388 | else:
389 | console.print("[yellow]Could not find captcha token[/yellow]")
390 | return None
391 |
392 | except Exception as e:
393 | console.print(f"[red]Error in AI captcha solver: {str(e)}[/red]")
394 | console.print(f"[green]Buy Premium solver for 25$ [/green]")
395 | return None
396 |
397 | def close(self):
398 | """Close the browser"""
399 | if self.browser:
400 | self.browser.quit()
401 |
--------------------------------------------------------------------------------
/generator.py:
--------------------------------------------------------------------------------
1 | import os
2 | import time
3 | import json
4 | import random
5 | import base64
6 | import threading
7 | import re
8 | import sys
9 | from typing import Optional
10 | import requests
11 | from colorama import Fore, Style, init
12 | import cursor
13 |
14 | from advanced_captcha_solver import AdvancedCaptchaSolver
15 | from rich.console import Console
16 | from rich.panel import Panel
17 | from rich.text import Text
18 | from dotenv import load_dotenv
19 |
20 | # Initialize colorama
21 | init(autoreset=True)
22 | console = Console()
23 |
24 | class DiscordTokenGenerator:
25 | def __init__(self):
26 | load_dotenv()
27 | # No API key needed for AI solver
28 | self.api_version = 10 # Discord's current API version
29 | self.base_url = f"https://discord.com/api/v{self.api_version}"
30 | # Fallback fingerprint in case API fails
31 | self.fallback_fingerprint = "" # Will be generated randomly
32 | # Create realistic browser headers
33 | browser_version = "121.0.0.0"
34 | self.headers = {
35 | "User-Agent": f"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{browser_version} Safari/537.36",
36 | "Accept": "*/*",
37 | "Accept-Language": "en-US,en;q=0.9",
38 | "Accept-Encoding": "gzip, deflate, br",
39 | "Content-Type": "application/json",
40 | "Origin": "https://discord.com",
41 | "Referer": "https://discord.com/register",
42 | "Sec-Ch-Ua": '"Google Chrome";v="121", "Not A(Brand";v="99", "Chromium";v="121"',
43 | "Sec-Ch-Ua-Mobile": "?0",
44 | "Sec-Ch-Ua-Platform": "\"Windows\"",
45 | "Sec-Fetch-Dest": "empty",
46 | "Sec-Fetch-Mode": "cors",
47 | "Sec-Fetch-Site": "same-origin",
48 | "X-Super-Properties": base64.b64encode(json.dumps({
49 | "os": "Windows",
50 | "browser": "Chrome",
51 | "device": "",
52 | "browser_user_agent": f"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{browser_version} Safari/537.36",
53 | "browser_version": browser_version,
54 | "os_version": "10",
55 | "referrer": "https://discord.com/",
56 | "referring_domain": "discord.com",
57 | "referrer_current": "https://discord.com/register",
58 | "referring_domain_current": "discord.com",
59 | "release_channel": "stable",
60 | "client_build_number": 245662,
61 | "client_event_source": None
62 | }).encode()).decode()
63 | }
64 | # Disable SSL warnings
65 | import urllib3
66 | urllib3.disable_warnings()
67 | self.session = requests.Session()
68 | self.captcha_tokens = []
69 | self.proxies = self.load_proxies()
70 |
71 | def display_banner(self):
72 | console.print("================ Discord Token Generator ================\n")
73 | console.print("[cyan]Created by:[/cyan] Dorukuz")
74 | console.print("[cyan]Version:[/cyan] 2.0 (AI-Powered)\n")
75 | console.print("[cyan]Links:[/cyan]")
76 | console.print("- Telegram: https://t.me/Dorukuz")
77 | console.print("- Telegram: https://t.me/axi1337")
78 | console.print("- Github: https://github.com/Dorukuz\n")
79 | console.print("[yellow]Status:[/yellow] AI Pattern Matcher Ready\n")
80 |
81 | def solve_captcha(self, site_key: str, site_url: str) -> Optional[str]:
82 | try:
83 | console.print("[cyan]Using Advanced AI Captcha Solver with multiple methods...[/cyan]")
84 | solver = AdvancedCaptchaSolver()
85 | result = solver.solve_captcha(site_key, site_url)
86 | if result:
87 | console.print("[green]Advanced AI successfully solved the captcha![/green]")
88 | return result
89 | else:
90 | console.print("[yellow]Advanced AI failed to solve the captcha, retrying...[/yellow]")
91 | return None
92 | except Exception as e:
93 | console.print(f"[red]Error in Advanced AI captcha solver: {str(e)}[/red]")
94 | return None
95 | finally:
96 | # Clean up resources
97 | if 'solver' in locals() and hasattr(solver, 'close'):
98 | try:
99 | solver.close()
100 | except:
101 | pass
102 |
103 | def fetch_proxies(self) -> list:
104 | try:
105 | console.print("[cyan]Fetching fresh proxies...[/cyan]")
106 | proxies = set()
107 |
108 | # Source 1: proxyscrape.com
109 | try:
110 | response = self.session.get(
111 | "https://api.proxyscrape.com/v2/?request=getproxies&protocol=http&timeout=10000&country=all&ssl=all&anonymity=all",
112 | verify=False
113 | )
114 | if response.status_code == 200:
115 | proxies.update(response.text.strip().split('\n'))
116 | except Exception as e:
117 | console.print(f"[yellow]Error fetching from source 1: {str(e)}[/yellow]")
118 |
119 | # Source 2: openproxy.space
120 | try:
121 | response = self.session.get(
122 | "https://openproxy.space/list/http",
123 | verify=False
124 | )
125 | if response.status_code == 200:
126 | proxies.update([f"{p['ip']}:{p['port']}" for p in response.json()['data']])
127 | except Exception as e:
128 | console.print(f"[yellow]Error fetching from source 2: {str(e)}[/yellow]")
129 |
130 | # Source 3: proxy-list.download
131 | try:
132 | response = self.session.get(
133 | "https://www.proxy-list.download/api/v1/get?type=http",
134 | verify=False
135 | )
136 | if response.status_code == 200:
137 | proxies.update(response.text.strip().split('\n'))
138 | except Exception as e:
139 | console.print(f"[yellow]Error fetching from source 3: {str(e)}[/yellow]")
140 |
141 | # Filter and verify proxies
142 | working_proxies = []
143 | console.print("[cyan]Testing proxies...[/cyan]")
144 |
145 | for proxy in proxies:
146 | if not proxy.strip():
147 | continue
148 | try:
149 | response = self.session.get(
150 | "https://www.google.com",
151 | proxies={"http": f"http://{proxy}", "https": f"http://{proxy}"},
152 | timeout=5,
153 | verify=False
154 | )
155 | if response.status_code == 200:
156 | working_proxies.append(proxy)
157 | console.print(f"[green]Found working proxy: {proxy}[/green]")
158 | if len(working_proxies) >= 10: # Get at least 10 working proxies
159 | break
160 | except:
161 | continue
162 |
163 | if working_proxies:
164 | console.print(f"[green]Successfully found {len(working_proxies)} working proxies[/green]")
165 | return working_proxies
166 | else:
167 | console.print("[yellow]No working proxies found, running without proxies[/yellow]")
168 | console.print("[green]20$ For HQ proxy : https://t.me/Dorukuz [/green]")
169 | return []
170 |
171 | except Exception as e:
172 | console.print(f"[red]Error fetching proxies: {str(e)}[/red]")
173 | return []
174 |
175 | def load_proxies(self) -> list:
176 | # First try to load from file
177 | if os.path.exists('proxies.txt'):
178 | try:
179 | with open('proxies.txt', 'r') as f:
180 | proxies = [line.strip() for line in f if line.strip()]
181 | if proxies:
182 | console.print("[green]Loaded proxies from proxies.txt[/green]")
183 | return proxies
184 | except Exception as e:
185 | console.print(f"[yellow]Error loading proxies from file: {str(e)}[/yellow]")
186 |
187 | # If no file or empty file, fetch from online
188 | return self.fetch_proxies()
189 |
190 | def _get_fingerprint(self, proxy_dict=None):
191 | """Try to get a fingerprint from Discord API"""
192 | try:
193 | # First try with a direct API request
194 | try:
195 | response = self.session.get(
196 | f"{self.base_url}/experiments",
197 | verify=False,
198 | proxies=proxy_dict,
199 | timeout=15
200 | )
201 | if response.status_code == 200 and "fingerprint" in response.text:
202 | return response.json()["fingerprint"]
203 | except Exception as e:
204 | console.print(f"[yellow]Direct API fingerprint failed: {str(e)}[/yellow]")
205 |
206 | # If direct API fails, try to get it from the register page HTML
207 | try:
208 | response = self.session.get(
209 | "https://discord.com/register",
210 | headers={**self.headers, "Content-Type": "text/html"},
211 | verify=False,
212 | proxies=proxy_dict,
213 | timeout=15
214 | )
215 |
216 | if response.status_code == 200:
217 | # Try to find the fingerprint in the HTML
218 | import re
219 | match = re.search(r'"fingerprint":"([^"]+)"', response.text)
220 | if match:
221 | return match.group(1)
222 | except Exception as e:
223 | console.print(f"[yellow]HTML extraction fingerprint failed: {str(e)}[/yellow]")
224 |
225 | # Both methods failed
226 | console.print("[red]Failed to get fingerprint from Discord[/red]")
227 | return None
228 |
229 | except Exception as e:
230 | console.print(f"[red]Error in fingerprint fetching: {str(e)}[/red]")
231 | return None
232 |
233 | def _generate_fallback_fingerprint(self):
234 | """Generate a fallback fingerprint if API fails"""
235 | if not self.fallback_fingerprint:
236 | # Discord fingerprints are 18 characters of hex
237 | import uuid
238 | # Generate a random fingerprint-like string
239 | self.fallback_fingerprint = uuid.uuid4().hex[:18]
240 | return self.fallback_fingerprint
241 |
242 | def generate_token(self, proxy: Optional[str] = None) -> Optional[str]:
243 | try:
244 | proxy_dict = None
245 | if proxy:
246 | proxy_dict = {
247 | "http": f"http://{proxy}",
248 | "https": f"http://{proxy}"
249 | }
250 |
251 | # First, try to get a fingerprint from Discord API
252 | fingerprint = self._get_fingerprint(proxy_dict)
253 |
254 | # If that fails, use a fallback method
255 | if not fingerprint:
256 | fingerprint = self._generate_fallback_fingerprint()
257 | console.print(f"[yellow]Using fallback fingerprint: {fingerprint}[/yellow]")
258 |
259 | # Solve Captcha
260 | captcha_key = self.solve_captcha(
261 | "4c672d35-0701-42b2-88c3-78380b0db560",
262 | "https://discord.com"
263 | )
264 |
265 | if not captcha_key:
266 | return None
267 |
268 | if captcha_key in self.captcha_tokens:
269 | console.print("[yellow]Captcha token already used, retrying...[/yellow]")
270 | return None
271 |
272 | # Generate random username and password
273 | username = f"User_{random.randint(10000, 99999)}"
274 | password = f"Password{random.randint(100000, 999999)}"
275 |
276 | # Register request
277 | payload = {
278 | "username": username,
279 | "password": password,
280 | "consent": True,
281 | "fingerprint": fingerprint,
282 | "captcha_key": captcha_key
283 | }
284 |
285 | try:
286 | # Create a session cookie first to appear more natural
287 | self.session.get(
288 | "https://discord.com/register",
289 | headers={**self.headers, "Content-Type": "text/html"},
290 | verify=False,
291 | proxies=proxy_dict
292 | )
293 |
294 | # Make the registration request
295 | response = self.session.post(
296 | f"{self.base_url}/auth/register",
297 | headers=self.headers,
298 | json=payload,
299 | verify=False,
300 | proxies=proxy_dict,
301 | timeout=20
302 | )
303 | except requests.exceptions.ConnectionError:
304 | console.print("[yellow]Connection reset by Discord. Retrying with delay...[/yellow]")
305 | time.sleep(10) # Wait before retry
306 |
307 | # Try with a fresh session
308 | self.session = requests.Session()
309 |
310 | try:
311 | # Get a new fingerprint
312 | fingerprint_response = self.session.get(
313 | f"{self.base_url}/experiments",
314 | verify=False,
315 | proxies=proxy_dict,
316 | timeout=15
317 | )
318 | if fingerprint_response.status_code == 200:
319 | payload["fingerprint"] = fingerprint_response.json()["fingerprint"]
320 |
321 | # Retry the request
322 | response = self.session.post(
323 | f"{self.base_url}/auth/register",
324 | headers=self.headers,
325 | json=payload,
326 | verify=False,
327 | proxies=proxy_dict,
328 | timeout=20
329 | )
330 | except Exception as e:
331 | console.print(f"[red]Connection failed on retry: {str(e)}[/red]")
332 | return None
333 |
334 | if response.status_code == 201:
335 | token = response.json().get("token")
336 | self.captcha_tokens.append(captcha_key)
337 | # Save account info
338 | with open("accounts.txt", "a") as f:
339 | f.write(f"{username}:{password}:{token}\n")
340 | console.print(f"[green]Successfully generated token: {token}")
341 | return token
342 | elif 'captcha_key' in response.text:
343 | console.print("[yellow]Captcha invalid, retrying...[/yellow]")
344 | return None
345 | elif 'The resource is being rate limited.' in response.text:
346 | retry_after = response.json().get('retry_after', 5)
347 | console.print(f"[yellow]Rate limited, waiting {retry_after} seconds...[/yellow]")
348 | time.sleep(retry_after)
349 | return self.generate_token(proxy)
350 | else:
351 | console.print(f"[red]Failed to generate token: {response.text}")
352 | return None
353 |
354 | except Exception as e:
355 | console.print(f"[red]Error generating token: {str(e)}")
356 | if proxy:
357 | console.print(f"[yellow]Retrying with different proxy...[/yellow]")
358 | new_proxy = random.choice(self.proxies) if self.proxies else None
359 | return self.generate_token(new_proxy)
360 | return None
361 |
362 | def run(self):
363 | cursor.hide()
364 | self.display_banner()
365 |
366 | while True:
367 | console.print("\n[cyan]Options:")
368 | console.print("[1] Generate Tokens")
369 | console.print("[2] Exit")
370 |
371 | try:
372 | choice = input("\nEnter your choice: ")
373 |
374 | if choice == "1":
375 | try:
376 | num_tokens = int(input("Enter number of tokens to generate: "))
377 | for i in range(num_tokens):
378 | # Give the user a chance to cancel
379 | console.print(f"\n[cyan]Generating token {i+1}/{num_tokens}... (Press Ctrl+C to cancel)[/cyan]")
380 | time.sleep(1)
381 |
382 | # Try up to 5 times with different approaches
383 | max_retries = 5
384 | success = False
385 |
386 | for retry in range(max_retries):
387 | if retry > 0:
388 | console.print(f"[yellow]Retry attempt {retry}/{max_retries-1}...[/yellow]")
389 |
390 | # Get a fresh proxy for each retry
391 | proxy = random.choice(self.proxies) if self.proxies and len(self.proxies) > 0 else None
392 | if proxy:
393 | console.print(f"[cyan]Using proxy: {proxy}[/cyan]")
394 | else:
395 | console.print("[yellow]No proxy available, trying direct connection[/yellow]")
396 |
397 | # Try with a fresh session for each retry
398 | if retry > 0:
399 | self.session = requests.Session()
400 | # Make it look like a new browser visit
401 | self.session.get(
402 | "https://discord.com",
403 | headers={**self.headers, "Content-Type": "text/html"},
404 | verify=False,
405 | timeout=10
406 | )
407 |
408 | token = self.generate_token(proxy)
409 | if token:
410 | with open("tokens.txt", "a") as f:
411 | f.write(f"{token}\n")
412 | success = True
413 | break
414 |
415 | # Wait between retries with increasing delay
416 | if retry < max_retries - 1:
417 | # Random delay to avoid pattern detection
418 | delay = random.uniform((retry + 1) * 2, (retry + 1) * 3)
419 | console.print(f"[yellow]Waiting {delay:.1f} seconds before next retry...[/yellow]")
420 | time.sleep(delay)
421 |
422 | if not success:
423 | console.print("[red]Failed to generate token after multiple attempts[/red]")
424 | console.print("[yellow]Discord may be blocking our requests. Try again later or with different proxies.[/yellow]")
425 |
426 | # Add random delay between token generations
427 | delay = random.uniform(2, 5)
428 | console.print(f"[cyan]Waiting {delay:.1f} seconds before next token...[/cyan]")
429 | time.sleep(delay)
430 | except ValueError:
431 | console.print("[red]Please enter a valid number")
432 |
433 | elif choice == "2":
434 | console.print("[yellow]Exiting...")
435 | break
436 |
437 | else:
438 | console.print("[red]Invalid choice!")
439 |
440 | except KeyboardInterrupt:
441 | console.print("\n[yellow]Exiting...")
442 | break
443 | except Exception as e:
444 | console.print(f"[red]Error: {str(e)}")
445 | break
446 |
447 | if __name__ == "__main__":
448 | generator = DiscordTokenGenerator()
449 | generator.run()
450 |
--------------------------------------------------------------------------------