silent-akinator-pro 1.2.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +81 -15
  2. package/package.json +4 -9
package/index.js CHANGED
@@ -1,20 +1,86 @@
1
- const { Akinator: BaseAki, AkinatorAnswer } = require("@aqul/akinator-api");
1
+ const axios = require('axios');
2
2
 
3
- class Akinator extends BaseAki {
4
- constructor(config = {}) {
5
- super({
6
- region: config.region || 'en',
7
- childMode: config.childMode || false
8
- });
9
-
10
- // 🚀 THE MOBILE APP SPOOF: Overwriting headers to bypass Cloudflare
11
- this.client.defaults.headers.common['User-Agent'] = 'Akinator/1.2.3 (Android; 13; Scale/2.0)';
12
- this.client.defaults.headers.common['Referer'] = 'https://en.akinator.com/';
13
- this.client.defaults.headers.common['X-Requested-With'] = 'com.digidust.akinator.freemium';
14
- this.client.defaults.headers.common['Accept'] = 'application/json';
3
+ class Akinator {
4
+ constructor(config = { region: 'en', childMode: false }) {
5
+ this.region = config.region || 'en';
6
+ this.childMode = config.childMode || false;
7
+ this.baseUrl = `https://${this.region}.akinator.com`;
8
+ this.session = null;
9
+ this.signature = null;
10
+ this.step = 0;
11
+ this.progress = 0;
12
+ this.question = null;
13
+ this.isWin = false;
14
+ this.sugestion_name = null;
15
+ this.sugestion_desc = null;
16
+ this.sugestion_photo = null;
15
17
 
16
- console.log("🧞 SILENT TECH: Android Handshake Initialized");
18
+ // 🚀 MOBILE SPOOFING HEADERS
19
+ this.headers = {
20
+ 'User-Agent': 'Akinator/1.2.3 (Android; 13; Scale/2.0)',
21
+ 'X-Requested-With': 'com.digidust.akinator.freemium',
22
+ 'Accept': 'application/json',
23
+ 'Referer': `https://${this.region}.akinator.com/`
24
+ };
25
+ }
26
+
27
+ async start() {
28
+ console.log("💀 SILENT TECH ENGINE v2.0: BOOTING...");
29
+ try {
30
+ const res = await axios.get(`${this.baseUrl}/new_session`, {
31
+ params: { childMod: this.childMode, player: 'website-desktop' },
32
+ headers: this.headers
33
+ });
34
+ const data = res.data.parameters;
35
+ this.session = data.identification.session;
36
+ this.signature = data.identification.signature;
37
+ this.question = data.step_information.question;
38
+ console.log("✅ SILENT TECH: Handshake Successful.");
39
+ return this;
40
+ } catch (e) {
41
+ throw new Error("Cloudflare Block: Akinator rejected the connection.");
42
+ }
43
+ }
44
+
45
+ async answer(ansId) {
46
+ try {
47
+ const res = await axios.get(`${this.baseUrl}/answer`, {
48
+ params: {
49
+ session: this.session,
50
+ signature: this.signature,
51
+ step: this.step,
52
+ answer: ansId
53
+ },
54
+ headers: this.headers
55
+ });
56
+ const data = res.data.parameters;
57
+ this.step++;
58
+ this.progress = parseFloat(data.progression);
59
+ this.question = data.question;
60
+
61
+ if (this.progress >= 95) {
62
+ await this.getWinner();
63
+ }
64
+ return this;
65
+ } catch (e) {
66
+ throw new Error("Lost connection to Akinator servers.");
67
+ }
68
+ }
69
+
70
+ async getWinner() {
71
+ const res = await axios.get(`${this.baseUrl}/list`, {
72
+ params: { session: this.session, signature: this.signature, step: this.step },
73
+ headers: this.headers
74
+ });
75
+ const elements = res.data.parameters.elements;
76
+ if (elements && elements.length > 0) {
77
+ this.isWin = true;
78
+ const char = elements[0].element;
79
+ this.sugestion_name = char.name;
80
+ this.sugestion_desc = char.description;
81
+ this.sugestion_photo = char.absolute_picture_path;
82
+ }
17
83
  }
18
84
  }
19
85
 
20
- module.exports = { Akinator, AkinatorAnswer };
86
+ module.exports = { Akinator };
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "silent-akinator-pro",
3
- "version": "1.2.2",
4
- "description": "Silent Tech Premium Akinator API. High-speed and professional.",
3
+ "version": "2.0.0",
4
+ "description": "Standalone High-Speed Akinator SDK. Bypasses Cloudflare using Mobile-Handshake logic. No dependencies required.",
5
5
  "main": "index.js",
6
- "keywords": [
7
- "akinator",
8
- "silent-tech",
9
- "wa-bot",
10
- "api"
11
- ],
6
+ "keywords": ["akinator", "aki", "silent-tech", "baileys", "wa-bot", "cloudflare-bypass"],
12
7
  "author": "Silent Tech",
13
8
  "license": "MIT",
14
9
  "dependencies": {
15
- "@aqul/akinator-api": "^3.0.1"
10
+ "axios": "^1.6.0"
16
11
  }
17
12
  }