mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2026-09-02 13:27:53 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd872490c8 | ||
|
|
be528d1a19 | ||
|
|
3bcaf40850 | ||
|
|
0ccac69bea | ||
|
|
48d63857e2 |
@@ -526,7 +526,7 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
|
|||||||
},
|
},
|
||||||
"qs": {
|
"qs": {
|
||||||
"l": language, // Default language
|
"l": language, // Default language
|
||||||
"count": 5000, // Max items per 'page'
|
"count": 2000, // Max items per 'page'
|
||||||
"start_assetid": start
|
"start_assetid": start
|
||||||
},
|
},
|
||||||
"json": true
|
"json": true
|
||||||
|
|||||||
14
index.js
14
index.js
@@ -65,7 +65,7 @@ SteamCommunity.prototype.login = function(details, callback) {
|
|||||||
this._setCookie(Request.cookie('steamMachineAuth' + parts[0] + '=' + encodeURIComponent(parts[1])), true);
|
this._setCookie(Request.cookie('steamMachineAuth' + parts[0] + '=' + encodeURIComponent(parts[1])), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
var disableMobile = details.disableMobile;
|
var disableMobile = typeof details.disableMobile == 'undefined' ? true : details.disableMobile;
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ SteamCommunity.prototype.login = function(details, callback) {
|
|||||||
"donotcache": Date.now()
|
"donotcache": Date.now()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!disableMobile){
|
if (!disableMobile) {
|
||||||
formObj.oauth_client_id = "DE45CD61";
|
formObj.oauth_client_id = "DE45CD61";
|
||||||
formObj.oauth_scope = "read_profile write_profile read_client write_client";
|
formObj.oauth_scope = "read_profile write_profile read_client write_client";
|
||||||
formObj.loginfriendlyname = "#login_emailauth_friendlyname_mobile";
|
formObj.loginfriendlyname = "#login_emailauth_friendlyname_mobile";
|
||||||
@@ -161,22 +161,20 @@ SteamCommunity.prototype.login = function(details, callback) {
|
|||||||
callback(error);
|
callback(error);
|
||||||
} else if (!body.success) {
|
} else if (!body.success) {
|
||||||
callback(new Error(body.message || "Unknown error"));
|
callback(new Error(body.message || "Unknown error"));
|
||||||
} else if (!disableMobile && !body.oauth) {
|
|
||||||
callback(new Error("Malformed response"));
|
|
||||||
} else {
|
} else {
|
||||||
var sessionID = generateSessionID();
|
var sessionID = generateSessionID();
|
||||||
var oAuth;
|
var oAuth = {};
|
||||||
self._setCookie(Request.cookie('sessionid=' + sessionID));
|
self._setCookie(Request.cookie('sessionid=' + sessionID));
|
||||||
|
|
||||||
var cookies = self._jar.getCookieString("https://steamcommunity.com").split(';').map(function(cookie) {
|
var cookies = self._jar.getCookieString("https://steamcommunity.com").split(';').map(function(cookie) {
|
||||||
return cookie.trim();
|
return cookie.trim();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!disableMobile){
|
if (!disableMobile && body.oauth) {
|
||||||
oAuth = JSON.parse(body.oauth);
|
oAuth = JSON.parse(body.oauth);
|
||||||
self.steamID = new SteamID(oAuth.steamid);
|
self.steamID = new SteamID(oAuth.steamid);
|
||||||
self.oAuthToken = oAuth.oauth_token;
|
self.oAuthToken = oAuth.oauth_token;
|
||||||
}else{
|
} else {
|
||||||
for(var i = 0; i < cookies.length; i++) {
|
for(var i = 0; i < cookies.length; i++) {
|
||||||
var parts = cookies[i].split('=');
|
var parts = cookies[i].split('=');
|
||||||
if(parts[0] == 'steamLogin') {
|
if(parts[0] == 'steamLogin') {
|
||||||
@@ -190,7 +188,7 @@ SteamCommunity.prototype.login = function(details, callback) {
|
|||||||
|
|
||||||
// Find the Steam Guard cookie
|
// Find the Steam Guard cookie
|
||||||
var steamguard = null;
|
var steamguard = null;
|
||||||
for(var i = 0; i < cookies.length; i++) {
|
for (var i = 0; i < cookies.length; i++) {
|
||||||
var parts = cookies[i].split('=');
|
var parts = cookies[i].split('=');
|
||||||
if(parts[0] == 'steamMachineAuth' + self.steamID) {
|
if(parts[0] == 'steamMachineAuth' + self.steamID) {
|
||||||
steamguard = self.steamID.toString() + '||' + decodeURIComponent(parts[1]);
|
steamguard = self.steamID.toString() + '||' + decodeURIComponent(parts[1]);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "steamcommunity",
|
"name": "steamcommunity",
|
||||||
"version": "3.44.2",
|
"version": "3.44.4",
|
||||||
"description": "Provides an interface for logging into and interacting with the Steam Community website",
|
"description": "Provides an interface for logging into and interacting with the Steam Community website",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"steam",
|
"steam",
|
||||||
|
|||||||
Reference in New Issue
Block a user