channel-worker 2.5.139 → 2.5.140
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/lib/nst-manager.js +39 -25
- package/package.json +1 -1
package/lib/nst-manager.js
CHANGED
|
@@ -21,6 +21,43 @@ function nstLaunchError(response, { profileId = '', runningCount = 0 } = {}) {
|
|
|
21
21
|
return error;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
// Every proxy in the fleet exits through Viettel VN, and GeoIP answers
|
|
25
|
+
// "Vietnam / Asia/Bangkok" for those IPs — so letting NST derive locale from
|
|
26
|
+
// the proxy turned every new profile into a Thai browser (th-TH, Asia/Bangkok).
|
|
27
|
+
// Measured 2026-09-25 on win-worker: 6/6 running profiles, FB login page in
|
|
28
|
+
// Thai for Vietnamese accounts. Pin what a Vietnamese user actually runs.
|
|
29
|
+
// If a non-VN proxy is ever added, this has to follow the proxy's country.
|
|
30
|
+
const VN_LOCALIZATION = {
|
|
31
|
+
basedOnProxy: false,
|
|
32
|
+
locale: 'vi-VN',
|
|
33
|
+
languages: ['vi-VN', 'vi', 'en-US', 'en'],
|
|
34
|
+
timezone: 'Asia/Ho_Chi_Minh',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Only pin the noise flags and the locale. CPU count, RAM, kernel version and
|
|
38
|
+
// UA stay with Nstbrowser's own randomiser: hard-coding hardwareConcurrency=8 /
|
|
39
|
+
// deviceMemory=8 / kernel 132 for EVERY profile made 22/22 running browsers
|
|
40
|
+
// identical (win-worker, 2026-08-22), which is exactly what lets a platform
|
|
41
|
+
// cluster a fleet of accounts. All FB/YT selectors are bilingual (vi + en).
|
|
42
|
+
function profileCreateBody(name, platform) {
|
|
43
|
+
return {
|
|
44
|
+
name,
|
|
45
|
+
platform,
|
|
46
|
+
fingerprint: {
|
|
47
|
+
flags: {
|
|
48
|
+
audio: 'Noise',
|
|
49
|
+
canvas: 'Noise',
|
|
50
|
+
fonts: 'Masked',
|
|
51
|
+
gpu: 'Allow',
|
|
52
|
+
webgl: 'Noise',
|
|
53
|
+
localization: 'Custom',
|
|
54
|
+
timezone: 'Custom',
|
|
55
|
+
},
|
|
56
|
+
localization: VN_LOCALIZATION,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
24
61
|
class NstManager {
|
|
25
62
|
constructor(apiKey, options = {}) {
|
|
26
63
|
this.apiKey = apiKey;
|
|
@@ -232,32 +269,9 @@ class NstManager {
|
|
|
232
269
|
|
|
233
270
|
const platform = (options.os || 'windows').toLowerCase() === 'mac' ? 'MacOS' : 'Windows';
|
|
234
271
|
console.log(`[nst] WARNING: Profile "${name}" NOT FOUND after 3 retries — creating new profile (${platform})...`);
|
|
235
|
-
// Only pin the noise flags. Everything else (CPU count, RAM, kernel
|
|
236
|
-
// version, UA, locale/timezone) is left to Nstbrowser's own randomiser.
|
|
237
|
-
// Previously this hard-coded hardwareConcurrency=8 / deviceMemory=8 /
|
|
238
|
-
// kernel 132 / en-US for EVERY profile, and NST honoured it — measured
|
|
239
|
-
// 2026-08-22 on win-worker: 22 running browsers, 22/22 identical on
|
|
240
|
-
// (chrome, cpu, ram, language, timezone, screen). Same machine fingerprint
|
|
241
|
-
// across a fleet of accounts is exactly what lets a platform cluster them.
|
|
242
|
-
// localization 'BasedOnProxy' lets NST derive locale + timezone from the
|
|
243
|
-
// proxy's geo, so a VN account on a VN proxy stops claiming it only speaks
|
|
244
|
-
// English. All FB/YT selectors are already bilingual (vi + en).
|
|
245
272
|
const res = await this.api('/profiles', {
|
|
246
273
|
method: 'POST',
|
|
247
|
-
body: JSON.stringify(
|
|
248
|
-
name,
|
|
249
|
-
platform,
|
|
250
|
-
fingerprint: {
|
|
251
|
-
flags: {
|
|
252
|
-
audio: 'Noise',
|
|
253
|
-
canvas: 'Noise',
|
|
254
|
-
fonts: 'Masked',
|
|
255
|
-
gpu: 'Allow',
|
|
256
|
-
webgl: 'Noise',
|
|
257
|
-
localization: 'BasedOnProxy',
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
}),
|
|
274
|
+
body: JSON.stringify(profileCreateBody(name, platform)),
|
|
261
275
|
});
|
|
262
276
|
|
|
263
277
|
const profileId = res?.data?.profileId || res?.data?._id;
|
|
@@ -446,4 +460,4 @@ class NstManager {
|
|
|
446
460
|
}
|
|
447
461
|
}
|
|
448
462
|
|
|
449
|
-
module.exports = { NstManager, nstLaunchError };
|
|
463
|
+
module.exports = { NstManager, nstLaunchError, profileCreateBody };
|