nodejs-insta-private-api-mqtt 1.1.0 → 1.1.2

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.
package/README.md CHANGED
@@ -8,6 +8,9 @@ The old repository and NPM package were lost and are now associated with a diffe
8
8
  Starting from today, this NPM account will be the official and active source where this library will be published and maintained.
9
9
  Please make sure you are using this package from this account only to receive future updates, fixes, and support.
10
10
 
11
+ You can subscribe to any Instagram topic in this library visit the bookstore code, it would help me a lot if you like this project and if it helps you!
12
+
13
+ If you see clones of nodejs-insta-private-api on npm don't download, it could be malicious code and you may have security issues on your Instagram accounts, always use this project or the nodejs-insta-private-api project but that's on the lost account, always use npm install nodejs-insta-private-api-mqtt in your projects
11
14
 
12
15
 
13
16
  # nodejs-insta-private-api-mqtt
@@ -16,7 +19,7 @@ This project implements a complete and production-ready MQTT protocol client for
16
19
 
17
20
  By leveraging MQTT instead of Instagram's REST API, this library achieves sub-500ms message latency, bidirectional real-time communication, and native support for notifications, presence tracking, and thread management. The implementation is reverse-engineered from Instagram's mobile app protocol and tested extensively for reliability and compatibility.
18
21
 
19
- ## Features (v5.61.11 - iOS + Android Full Support)
22
+ ## Features ( - iOS + Android Full Support)
20
23
 
21
24
  - **NEW: FULL iOS SUPPORT** - iPhone 16/15/14/13/12 + iPad Pro/Air device emulation
22
25
  - **NEW: FULL ANDROID SUPPORT** - Samsung, Huawei, Google Pixel, OnePlus, Xiaomi, OPPO
@@ -72,7 +75,7 @@ Requires **Node.js 18 or higher**.
72
75
 
73
76
  ---
74
77
 
75
- ## NEW: Custom Device Emulation (v5.60.7)
78
+ ## NEW: Custom Device Emulation ()
76
79
 
77
80
  **Default Device:** Samsung Galaxy S25 Ultra (Android 15) - used automatically if you don't set a custom device.
78
81
 
@@ -84,8 +84,8 @@ exports.FBNS = {
84
84
  PACKAGE: 'com.instagram.android',
85
85
  APP_ID: '567310203415052',
86
86
  HOST_NAME_V6: 'mqtt-mini.facebook.com',
87
- CLIENT_CAPABILITIES: 439,
88
- ENDPOINT_CAPABILITIES: 128,
87
+ CLIENT_CAPABILITIES: 6143,
88
+ ENDPOINT_CAPABILITIES: 255,
89
89
  CLIENT_STACK: 3,
90
90
  PUBLISH_FORMAT: 1,
91
91
  };
@@ -14,7 +14,14 @@ class Request {
14
14
  timeout: 30000,
15
15
  headers: {
16
16
  'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
17
- }
17
+ },
18
+ // Modern TLS settings to bypass basic fingerprinting (Strict Instagram Fizz mimicry)
19
+ httpsAgent: new (require('https').Agent)({
20
+ ciphers: 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305',
21
+ honorCipherOrder: true,
22
+ minVersion: 'TLSv1.3', // Instagram 2026 enforces TLS 1.3
23
+ maxVersion: 'TLSv1.3'
24
+ })
18
25
  });
19
26
  }
20
27
 
@@ -201,6 +208,9 @@ class Request {
201
208
  'X-IG-Android-ID': this.client.state.deviceId,
202
209
  'Accept-Language': this.client.state.language.replace('_', '-'),
203
210
  'X-FB-HTTP-Engine': 'Liger',
211
+ 'X-FB-Client-IP': 'True',
212
+ 'X-FB-Server-Cluster': 'True',
213
+ 'X-IG-Nav-Chain': 'MainFeed:FeedTimelineFragment:1',
204
214
  'Authorization': this.client.state.authorization,
205
215
  'Host': 'i.instagram.com',
206
216
  'Accept-Encoding': 'gzip, deflate',
@@ -21,8 +21,10 @@ class State {
21
21
  this.language = 'en_US';
22
22
  this.timezoneOffset = String(new Date().getTimezoneOffset() * -60);
23
23
  this.radioType = 'wifi-none';
24
- this.capabilitiesHeader = '3brTv10=';
24
+ this.capabilitiesHeader = '3brTvw==';
25
25
  this.connectionTypeHeader = 'WIFI';
26
+ this.clientCapabilities = 6143;
27
+ this.endpointCapabilities = 255;
26
28
  this.isLayoutRTL = false;
27
29
  this.adsOptOut = false;
28
30
  this.thumbnailCacheBustingValue = 1000;
@@ -35,10 +37,14 @@ class State {
35
37
 
36
38
  // ===== PLATFORM SUPPORT (iOS + Android) =====
37
39
  this.platform = 'android'; // 'android' or 'ios'
40
+ this.androidVersion = '15';
41
+ this.androidApiLevel = '35';
42
+ this.appVersion = '380.0.0.40.94';
43
+ this.appVersionCode = '525123456';
38
44
  this.iosVersion = '18.1';
39
- this.iosAppVersion = '347.0.0.36.89';
40
- this.iosAppVersionCode = '618023787';
41
- this.iosDeviceModel = 'iPhone16,2'; // iPhone 15 Pro Max
45
+ this.iosAppVersion = '411.0.0';
46
+ this.iosAppVersionCode = '700123456';
47
+ this.iosDeviceModel = 'iPhone17,1'; // iPhone 16 Pro Max
42
48
  this.iosDeviceName = 'iPhone';
43
49
  this.iosBundleId = 'com.burbn.instagram';
44
50
 
@@ -23,12 +23,26 @@ class MQTToTClient extends mqtts_1.MqttClient {
23
23
  host: options.url,
24
24
  port: 443,
25
25
  proxyOptions: options.socksOptions,
26
- additionalOptions: options.additionalOptions,
26
+ additionalOptions: {
27
+ ...options.additionalOptions,
28
+ ciphers: 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256',
29
+ minVersion: 'TLSv1.3',
30
+ maxVersion: 'TLSv1.3',
31
+ honorCipherOrder: true,
32
+ ALPNProtocols: ['h2', 'mqtt']
33
+ },
27
34
  })
28
35
  : new mqtts_1.TlsTransport({
29
36
  host: options.url,
30
37
  port: 443,
31
- additionalOptions: options.additionalOptions,
38
+ additionalOptions: {
39
+ ...options.additionalOptions,
40
+ ciphers: 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256',
41
+ minVersion: 'TLSv1.3',
42
+ maxVersion: 'TLSv1.3',
43
+ honorCipherOrder: true,
44
+ ALPNProtocols: ['h2', 'mqtt']
45
+ },
32
46
  }),
33
47
  });
34
48
  this.mqttotDebug = (msg, ...args) => (0, shared_1.debugChannel)('mqttot')(`${options.url}: ${msg}`, ...args);
@@ -100,7 +114,7 @@ function mqttotConnectFlow(payload, requirePayload) {
100
114
  type: mqtts_1.PacketType.Connect,
101
115
  options: {
102
116
  payload,
103
- keepAlive: 60,
117
+ keepAlive: 120,
104
118
  },
105
119
  }),
106
120
  accept: mqtts_1.isConnAck,
@@ -7,6 +7,8 @@ class MQTToTConnection {
7
7
  this.fbnsConnectionData = connectionData;
8
8
  }
9
9
  toThrift() {
10
+ this.fbnsConnectionData.clientCapabilities = this.fbnsConnectionData.clientCapabilities || 6143;
11
+ this.fbnsConnectionData.endpointCapabilities = this.fbnsConnectionData.endpointCapabilities || 255;
10
12
  return (0, thrift_1.thriftWriteFromObject)(this.fbnsConnectionData, MQTToTConnection.thriftConfig);
11
13
  }
12
14
  toString() {
@@ -21,10 +21,10 @@ function createFbnsUserAgent(ig) {
21
21
  FBBD: 'Android',
22
22
  FBPN: 'com.instagram.android',
23
23
  FBDV: deviceName.trim(),
24
- FBSV: androidVersion.split('/')[1],
24
+ FBSV: ig.state.androidVersion,
25
25
  FBLR: '0',
26
26
  FBBK: '1',
27
- FBCA: 'x86:armeabi-v7a',
27
+ FBCA: 'arm64-v8a:armeabi-v7a:armeabi',
28
28
  };
29
29
  return `[${Object.entries(params)
30
30
  .map(p => p.join('/'))
@@ -32,7 +32,7 @@ function createFbnsUserAgent(ig) {
32
32
  }
33
33
  exports.createFbnsUserAgent = createFbnsUserAgent;
34
34
  function compressDeflate(data) {
35
- return deflatePromise(data, { level: 9 });
35
+ return deflatePromise(data, { level: 6, windowBits: -15 });
36
36
  }
37
37
  exports.compressDeflate = compressDeflate;
38
38
  function unzipAsync(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodejs-insta-private-api-mqtt",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Complete Instagram MQTT protocol with FULL iOS + Android support. 33 device presets (21 iOS + 12 Android). iPhone 16/15/14/13/12, iPad Pro, Samsung, Pixel, Huawei. Real-time DM messaging, view-once media extraction, sub-500ms latency.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {