gologin-commonjs 1.1.6 → 1.1.8
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/dist/src/gologin.js +9 -32
- package/gologin/src/gologin.js +8 -32
- package/package.json +1 -1
- package/tsconfig.json +0 -1
package/dist/src/gologin.js
CHANGED
|
@@ -40,9 +40,10 @@ var _browser = require("./utils/browser.js");
|
|
|
40
40
|
var _common = require("./utils/common.js");
|
|
41
41
|
var _constants = require("./utils/constants.js");
|
|
42
42
|
var _utils2 = require("./utils/utils.js");
|
|
43
|
-
var _timezone = require("./utils/timezone.js");
|
|
44
43
|
var _gologinApi = require("./gologin-api.js");
|
|
45
44
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
45
|
+
// import { tzlookup } from "./utils/timezone.js";
|
|
46
|
+
|
|
46
47
|
const {
|
|
47
48
|
access,
|
|
48
49
|
unlink,
|
|
@@ -618,43 +619,19 @@ class GoLogin {
|
|
|
618
619
|
}
|
|
619
620
|
const proxyUrl = `${proxy.mode}://${proxy.username}:${proxy.password}@${proxy.host}:${proxy.port}`;
|
|
620
621
|
debug(`getTimeZone start ${TIMEZONE_URL}`, proxyUrl);
|
|
621
|
-
|
|
622
|
+
data = await _requestretry.default.get(TIMEZONE_URL, {
|
|
622
623
|
proxy: proxyUrl,
|
|
623
|
-
timeout:
|
|
624
|
-
maxAttempts:
|
|
624
|
+
timeout: 3 * 1000,
|
|
625
|
+
maxAttempts: 3
|
|
625
626
|
});
|
|
626
|
-
const result = JSON.parse(response.body);
|
|
627
|
-
data = {
|
|
628
|
-
body: {
|
|
629
|
-
country: result.country_code,
|
|
630
|
-
stateProv: result.city,
|
|
631
|
-
city: result.city,
|
|
632
|
-
timezone: (0, _timezone.tzlookup)(result.latitude, result.longitude),
|
|
633
|
-
ll: [result.latitude, result.longitude],
|
|
634
|
-
languages: "en",
|
|
635
|
-
accuracy: 100
|
|
636
|
-
}
|
|
637
|
-
};
|
|
638
627
|
} else {
|
|
639
|
-
|
|
640
|
-
timeout:
|
|
641
|
-
maxAttempts:
|
|
628
|
+
data = await _requestretry.default.get(TIMEZONE_URL, {
|
|
629
|
+
timeout: 3 * 1000,
|
|
630
|
+
maxAttempts: 3
|
|
642
631
|
});
|
|
643
|
-
const result = JSON.parse(response.body);
|
|
644
|
-
data = {
|
|
645
|
-
body: {
|
|
646
|
-
country: result.country_code,
|
|
647
|
-
stateProv: result.city,
|
|
648
|
-
city: result.city,
|
|
649
|
-
timezone: (0, _timezone.tzlookup)(result.latitude, result.longitude),
|
|
650
|
-
ll: [result.latitude, result.longitude],
|
|
651
|
-
languages: "en",
|
|
652
|
-
accuracy: 100
|
|
653
|
-
}
|
|
654
|
-
};
|
|
655
632
|
}
|
|
656
633
|
debug("getTimeZone finish", data.body);
|
|
657
|
-
this._tz = data.body;
|
|
634
|
+
this._tz = JSON.parse(data.body);
|
|
658
635
|
return this._tz.timezone;
|
|
659
636
|
}
|
|
660
637
|
async getTimezoneWithSocks(params) {
|
package/gologin/src/gologin.js
CHANGED
|
@@ -38,7 +38,7 @@ import { checkAutoLang } from "./utils/browser.js";
|
|
|
38
38
|
import { API_URL, getOsAdvanced } from "./utils/common.js";
|
|
39
39
|
import { STORAGE_GATEWAY_BASE_URL } from "./utils/constants.js";
|
|
40
40
|
import { get, isPortReachable } from "./utils/utils.js";
|
|
41
|
-
import { tzlookup } from "./utils/timezone.js";
|
|
41
|
+
// import { tzlookup } from "./utils/timezone.js";
|
|
42
42
|
export { exitAll, GologinApi } from "./gologin-api.js";
|
|
43
43
|
|
|
44
44
|
const { access, unlink, writeFile, readFile } = _promises;
|
|
@@ -838,44 +838,20 @@ export class GoLogin {
|
|
|
838
838
|
|
|
839
839
|
const proxyUrl = `${proxy.mode}://${proxy.username}:${proxy.password}@${proxy.host}:${proxy.port}`;
|
|
840
840
|
debug(`getTimeZone start ${TIMEZONE_URL}`, proxyUrl);
|
|
841
|
-
|
|
841
|
+
data = await requests.get(TIMEZONE_URL, {
|
|
842
842
|
proxy: proxyUrl,
|
|
843
|
-
timeout:
|
|
844
|
-
maxAttempts:
|
|
843
|
+
timeout: 3 * 1000,
|
|
844
|
+
maxAttempts: 3,
|
|
845
845
|
});
|
|
846
|
-
const result = JSON.parse(response.body);
|
|
847
|
-
data = {
|
|
848
|
-
body: {
|
|
849
|
-
country: result.country_code,
|
|
850
|
-
stateProv: result.city,
|
|
851
|
-
city: result.city,
|
|
852
|
-
timezone: tzlookup(result.latitude, result.longitude),
|
|
853
|
-
ll: [result.latitude, result.longitude],
|
|
854
|
-
languages: "en",
|
|
855
|
-
accuracy: 100,
|
|
856
|
-
},
|
|
857
|
-
};
|
|
858
846
|
} else {
|
|
859
|
-
|
|
860
|
-
timeout:
|
|
861
|
-
maxAttempts:
|
|
847
|
+
data = await requests.get(TIMEZONE_URL, {
|
|
848
|
+
timeout: 3 * 1000,
|
|
849
|
+
maxAttempts: 3,
|
|
862
850
|
});
|
|
863
|
-
const result = JSON.parse(response.body);
|
|
864
|
-
data = {
|
|
865
|
-
body: {
|
|
866
|
-
country: result.country_code,
|
|
867
|
-
stateProv: result.city,
|
|
868
|
-
city: result.city,
|
|
869
|
-
timezone: tzlookup(result.latitude, result.longitude),
|
|
870
|
-
ll: [result.latitude, result.longitude],
|
|
871
|
-
languages: "en",
|
|
872
|
-
accuracy: 100,
|
|
873
|
-
},
|
|
874
|
-
};
|
|
875
851
|
}
|
|
876
852
|
|
|
877
853
|
debug("getTimeZone finish", data.body);
|
|
878
|
-
this._tz = data.body;
|
|
854
|
+
this._tz = JSON.parse(data.body);
|
|
879
855
|
|
|
880
856
|
return this._tz.timezone;
|
|
881
857
|
}
|
package/package.json
CHANGED