Compare commits

...

17 Commits

Author SHA1 Message Date
Alex Corn
d3e90f6fd3 3.49.0 2025-07-19 05:00:47 -04:00
Alex Corn
a61b50b7a2 Added acknowledgeTradeProtection method 2025-07-19 04:59:15 -04:00
Alex Corn
39fe4a4106 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	package.json
2025-07-19 04:49:23 -04:00
Alex Corn
0d991c2655 3.48.8 2025-05-28 05:23:39 -04:00
Alex Corn
0a307de9b9 Prevent descriptions overwriting base econ item properties 2025-05-28 05:23:25 -04:00
Alex Corn
c0b8dcf3a2 3.48.7 2025-05-27 20:27:10 -04:00
DoctorMcKay
dcf00b4ea1 Merge pull request #354 from metzz1/master
fix: steam now only accepts 1000 <
2025-05-27 20:26:40 -04:00
metzz
ee0cc34512 fix: steam now only accepts 1000 < 2025-05-28 03:08:12 +03:00
Alex Corn
c52533ea06 3.48.6 2025-02-12 03:16:04 -05:00
Alex Corn
67774f86f7 Handle "empty" CS2 inventories that aren't actually empty 2025-02-12 03:15:54 -05:00
Alex Corn
2f03e09f50 Require steam-session 1.9.1 2025-02-12 03:05:15 -05:00
Alex Corn
2868b1f45f Fixed malformed sessionid returned in login callback 2025-02-12 03:05:07 -05:00
Alex Corn
ac222ef8c3 Add origin header to all non-GET requests 2025-02-12 03:04:45 -05:00
Alex Corn
4b8799ddd4 3.48.5 2024-11-02 02:54:44 -04:00
Alex Corn
f02f85a2aa Don't error out if a CS inventory has no visible items 2024-11-02 02:54:16 -04:00
Alex Corn
4948cbeac0 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	package.json
2024-11-02 02:49:14 -04:00
Alex Corn
0fb2798424 3.48.3 2024-04-18 06:04:25 -04:00
6 changed files with 40 additions and 5 deletions

View File

@@ -28,7 +28,7 @@ function CEconItem(item, description, contextID) {
}
for (thing in description) {
if (description.hasOwnProperty(thing)) {
if (description.hasOwnProperty(thing) && !this.hasOwnProperty(thing)) {
this[thing] = description[thing];
}
}

View File

@@ -392,6 +392,22 @@ SteamCommunity.prototype.checkConfirmations = function() {
}
};
SteamCommunity.prototype.acknowledgeTradeProtection = function(callback) {
this.httpRequestPost({
uri: 'https://steamcommunity.com//trade/new/acknowledge',
form: {
sessionid: this.getSessionID(),
message: 1
}
}, (err, res, body) => {
if (err) {
return callback && callback(err);
}
callback && callback(null);
}, 'steamcommunity');
}
SteamCommunity.prototype._confirmationCheckerGetKey = function(tag, callback) {
if(this._identitySecret) {
if(tag == 'details') {

View File

@@ -1,3 +1,5 @@
var URL = require('url');
var SteamCommunity = require('../index.js');
SteamCommunity.prototype.httpRequest = function(uri, options, callback, source) {
@@ -19,6 +21,16 @@ SteamCommunity.prototype.httpRequest = function(uri, options, callback, source)
delete this._httpRequestConvenienceMethod;
}
// Add origin header if necessary
// https://github.com/DoctorMcKay/node-steamcommunity/issues/351
if ((options.method || 'GET').toUpperCase() != 'GET') {
options.headers = options.headers || {};
if (!options.headers.origin) {
var parsedUrl = URL.parse(options.url);
options.headers.origin = parsedUrl.protocol + '//' + parsedUrl.host;
}
}
var requestID = ++this._httpRequestID;
source = source || "";

View File

@@ -54,7 +54,7 @@ SteamCommunity.prototype._modernLogin = function(logOnDetails) {
let webCookies = await session.getWebCookies();
let sessionIdCookie = webCookies.find(c => c.startsWith('sessionid='));
resolve({
sessionID: sessionIdCookie.split('=')[1],
sessionID: sessionIdCookie.split('=')[1].split(';')[0].trim(),
cookies: webCookies,
steamguard: session.steamGuardMachineToken,
mobileAccessToken: logOnDetails.disableMobile ? null : session.accessToken

View File

@@ -590,7 +590,7 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
},
"qs": {
"l": language, // Default language
"count": 5000, // Max items per 'page'
"count": 1000, // Max items per 'page'
"start_assetid": start
},
"json": true
@@ -629,6 +629,13 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
return;
}
if (appID == 730 && body && body.success && !body.assets) {
// CS inventory has no visible items. We need a special case for this because Valve is incapable of
// doing anything not dumb.
callback(null, [], [], body.total_inventory_count);
return;
}
if (!body || !body.success || !body.assets || !body.descriptions) {
if (body) {
// Dunno if the error/Error property even exists on this new endpoint

View File

@@ -1,6 +1,6 @@
{
"name": "steamcommunity",
"version": "3.48.4",
"version": "3.49.0",
"description": "Provides an interface for logging into and interacting with the Steam Community website",
"files": [
"/classes",
@@ -33,7 +33,7 @@
"cheerio": "0.22.0",
"image-size": "^0.8.2",
"request": "^2.88.0",
"steam-session": "^1.7.2",
"steam-session": "^1.9.1",
"steam-totp": "^1.5.0",
"steamid": "^1.1.3",
"xml2js": "^0.6.2"