steamutils 1.0.47 → 1.0.48
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/example.js +20 -8
- package/index.js +18 -0
- package/package.json +1 -1
package/example.js
CHANGED
@@ -1,13 +1,25 @@
|
|
1
1
|
import SteamUser from "./index.js";
|
2
|
+
import Steamutils from "./index.js";
|
2
3
|
|
3
4
|
(async function () {
|
4
|
-
const loginResult = await SteamUser.communityLogin({
|
5
|
-
|
6
|
-
|
7
|
-
})
|
8
|
-
console.log(loginResult.cookie);
|
9
|
-
const user = new SteamUser(loginResult.cookie)
|
10
|
-
const friendList = await user.turningSteamGuardOff()
|
5
|
+
// const loginResult = await SteamUser.communityLogin({
|
6
|
+
// username: "abc",
|
7
|
+
// password: "xyz",
|
8
|
+
// })
|
9
|
+
// console.log(loginResult.cookie);
|
10
|
+
// const user = new SteamUser(loginResult.cookie)
|
11
|
+
// const friendList = await user.turningSteamGuardOff()
|
11
12
|
// const friendList = await user.turningEmailAuthenticatorCheckOn()
|
12
|
-
console.log(friendList);
|
13
|
+
// console.log(friendList);
|
14
|
+
|
15
|
+
|
16
|
+
const user = new Steamutils([
|
17
|
+
"Steam_Language=english",
|
18
|
+
"timezoneOffset=0,0",
|
19
|
+
"steamCountry=VN%7C3c7bd5df99a265a3e5102a225d1ab62d",
|
20
|
+
"steamLoginSecure=76561199503410145%7C%7C82A70985FC6EDB855F20317D1376BB436866997E",
|
21
|
+
"sessionid=46f8f237c39047bae7892f97"
|
22
|
+
])
|
23
|
+
const email = await user.getAccountEmail()
|
24
|
+
console.log(email);
|
13
25
|
})()
|
package/index.js
CHANGED
@@ -4363,6 +4363,24 @@ class SteamUser {
|
|
4363
4363
|
daysSinceLastBan
|
4364
4364
|
}
|
4365
4365
|
}
|
4366
|
+
|
4367
|
+
async getAccountEmail() {
|
4368
|
+
const result = await this._httpRequest('https://store.steampowered.com/account/')
|
4369
|
+
if (!result.data) {
|
4370
|
+
return
|
4371
|
+
}
|
4372
|
+
const $ = result._$()
|
4373
|
+
let email = ''
|
4374
|
+
$('.account_setting_block').each(function () {
|
4375
|
+
if (email) return
|
4376
|
+
const account_setting_block = $(this)
|
4377
|
+
const account_data_field = account_setting_block.find('.account_manage_label + span.account_data_field')
|
4378
|
+
if (account_data_field.prev().text()?.trim() == 'Email address:') {
|
4379
|
+
email = account_data_field.text()
|
4380
|
+
}
|
4381
|
+
})
|
4382
|
+
return email
|
4383
|
+
}
|
4366
4384
|
}
|
4367
4385
|
|
4368
4386
|
export default SteamUser
|