gologin 2.0.12 → 2.0.13
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.
|
@@ -19,13 +19,13 @@ import GoLogin from '../src/gologin.js';
|
|
|
19
19
|
startUrl: 'https://testurl.com',
|
|
20
20
|
googleServicesEnabled: true,
|
|
21
21
|
lockEnabled: true,
|
|
22
|
-
proxy: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
22
|
+
// proxy: { // uncomment and check input if you need to use proxy
|
|
23
|
+
// mode: 'http', // 'socks4', 'socks5'
|
|
24
|
+
// host: '123.12.123.12',
|
|
25
|
+
// port: 1234,
|
|
26
|
+
// username: 'user',
|
|
27
|
+
// password: 'password',
|
|
28
|
+
// },
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -11,17 +11,17 @@ const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
|
11
11
|
|
|
12
12
|
const profile_id = await GL.create({
|
|
13
13
|
name: 'profile_mac',
|
|
14
|
-
os: 'mac',
|
|
14
|
+
os: 'mac', // 'win', 'lin', 'android'
|
|
15
|
+
// isM1: true, // for Mac M1
|
|
15
16
|
navigator: {
|
|
16
|
-
language: '
|
|
17
|
+
language: 'en-US,en;q=0.9',
|
|
17
18
|
userAgent: 'random', // get random user agent for selected os
|
|
18
19
|
resolution: '1024x768',
|
|
19
|
-
platform: 'mac',
|
|
20
20
|
},
|
|
21
21
|
proxyEnabled: false,
|
|
22
22
|
proxy: {
|
|
23
23
|
mode: 'none',
|
|
24
|
-
}
|
|
24
|
+
},
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
console.log('profile id=', profile_id);
|
package/package.json
CHANGED
package/src/gologin.js
CHANGED
|
@@ -1065,7 +1065,12 @@ export class GoLogin {
|
|
|
1065
1065
|
os = options.os;
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
|
-
|
|
1068
|
+
let url = `${API_URL}/browser/fingerprint?os=${os}`;
|
|
1069
|
+
if (options.isM1) {
|
|
1070
|
+
url += '&isM1=true';
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
const fingerprint = await requests.get(url,{
|
|
1069
1074
|
headers: {
|
|
1070
1075
|
'Authorization': `Bearer ${this.access_token}`,
|
|
1071
1076
|
'User-Agent': 'gologin-api',
|
|
@@ -1116,12 +1121,20 @@ export class GoLogin {
|
|
|
1116
1121
|
|
|
1117
1122
|
const user_agent = options.navigator?.userAgent;
|
|
1118
1123
|
const orig_user_agent = json.navigator.userAgent;
|
|
1119
|
-
Object.keys(options).
|
|
1120
|
-
json[
|
|
1124
|
+
Object.keys(options).forEach((key) => {
|
|
1125
|
+
if (typeof json[key] === 'object') {
|
|
1126
|
+
json[key] = { ...json[key], ...options[key] };
|
|
1127
|
+
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
json[key] = options[key];
|
|
1121
1132
|
});
|
|
1133
|
+
|
|
1122
1134
|
if (user_agent === 'random') {
|
|
1123
1135
|
json.navigator.userAgent = orig_user_agent;
|
|
1124
1136
|
}
|
|
1137
|
+
|
|
1125
1138
|
// console.log('profileOptions', json);
|
|
1126
1139
|
|
|
1127
1140
|
const response = await requests.post(`${API_URL}/browser`, {
|