nodejs-insta-private-api-mqtt 1.1.1 → 1.1.3

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.
@@ -84,14 +84,16 @@ 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
  };
92
92
  exports.REALTIME = {
93
93
  HOST_NAME_V6: 'edge-mqtt.facebook.com',
94
94
  };
95
+ exports.APP_VERSION = '380.0.0.40.94';
96
+ exports.APP_VERSION_CODE = '525123456';
95
97
  // TODO: exclude in release
96
98
  /* eslint @typescript-eslint/no-unused-vars: "off" */
97
99
  exports.PossibleTopics = [
@@ -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,12 @@ 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';
38
42
  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
43
+ this.iosAppVersion = '411.0.0';
44
+ this.iosAppVersionCode = '700123456';
45
+ this.iosDeviceModel = 'iPhone17,1'; // iPhone 16 Pro Max
42
46
  this.iosDeviceName = 'iPhone';
43
47
  this.iosBundleId = 'com.burbn.instagram';
44
48
 
@@ -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.1",
3
+ "version": "1.1.3",
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": {