Compare commits

...

13 Commits

Author SHA1 Message Date
Alex Corn
1c1ff82543 3.48.4 2024-10-05 18:50:47 -04:00
Alex Corn
63015259af Updated readme 2024-10-05 18:47:05 -04:00
Alex Corn
ad67805ad9 Prevent committing twofactor files to git 2024-10-05 18:45:26 -04:00
DoctorMcKay
3347d87f29 Merge pull request #347 from benschool/master
Fixes cache_expiration restore for CS2 Items
2024-10-05 18:41:48 -04:00
Benjamin Tyler
c97351543a Fixes cache_expiration restore for CS2 Items
As of Oct 2024, CS2 Item owner_description has changed from "Tradable After" to "Tradable/Marketable After".
2024-10-04 16:04:47 +01:00
DoctorMcKay
1067d4572e Merge pull request #341 from makss/reduce_redirects
Reduce Steam redirects
2024-04-29 10:21:41 -04:00
makss
49a7165052 Reduce Steam redirects 2024-04-29 16:40:01 +03:00
DoctorMcKay
e16136866c Merge pull request #340 from nolddor/patch-1
fix: getUserInventoryContents() make unnecesary calls
2024-04-18 06:04:06 -04:00
Jack Nolddor
cae85433f9 fix: getUserInventoryContents() make unnecesary calls
Steam inventory limits are back to normal there is no reason to just gather 2k items instead 5k max allowed by API
2024-04-18 08:14:14 +02:00
Alex Corn
ba6e29c935 3.48.2 2024-01-18 06:12:30 -05:00
Alex Corn
de95e25867 Fixed steamID not being properly set when cookies have a domain attribute 2024-01-18 06:12:18 -05:00
Alex Corn
e1820efeca 3.48.1 2024-01-18 05:38:41 -05:00
Alex Corn
7cee24199f Fixed login issue caused by differing tokens on different domains 2024-01-18 05:38:06 -05:00
8 changed files with 21 additions and 17 deletions

View File

@@ -4,9 +4,8 @@
[![license](https://img.shields.io/npm/l/steamcommunity.svg)](https://github.com/DoctorMcKay/node-steamcommunity/blob/master/LICENSE)
[![paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=N36YVAT42CZ4G&item_name=node%2dsteamcommunity&currency_code=USD)
This module provides an easy interface for the Steam Community website. This module can be used to simply login to steamcommunity.com for use with other libraries, or to interact with steamcommunity.com.
It supports Steam Guard and CAPTCHAs.
This module provides an easy interface for the Steam Community website. This module can be used to simply login to
steamcommunity.com for use with other libraries, or to interact with steamcommunity.com.
**Have a question about the module or coding in general? *Do not create a GitHub issue.* GitHub issues are for feature
requests and bug reports. Instead, post in the [dedicated forum](https://dev.doctormckay.com/forum/8-node-steamcommunity/).

View File

@@ -68,9 +68,9 @@ function CEconItem(item, description, contextID) {
// Restore cache_expiration, if we can (for CS:GO items)
if (this.appid == 730 && this.contextid == 2 && this.owner_descriptions) {
let description = this.owner_descriptions.find(d => d.value && d.value.indexOf('Tradable After ') == 0);
let description = this.owner_descriptions.find(d => d.value && d.value.indexOf('Tradable/Marketable After ') == 0);
if (description) {
let date = new Date(description.value.substring(15).replace(/[,()]/g, ''));
let date = new Date(description.value.substring(26).replace(/[,()]/g, ''));
if (date) {
this.cache_expiration = date.toISOString();
}

View File

@@ -13,7 +13,7 @@ SteamCommunity.prototype.getSteamUser = function(id, callback) {
}
var self = this;
this.httpRequest("http://steamcommunity.com/" + (typeof id === 'string' ? "id/" + id : "profiles/" + id.toString()) + "/?xml=1", function(err, response, body) {
this.httpRequest("https://steamcommunity.com/" + (typeof id === 'string' ? "id/" + id : "profiles/" + id.toString()) + "/?xml=1", function(err, response, body) {
if (err) {
callback(err);
return;

View File

@@ -11,17 +11,17 @@ SteamCommunity.prototype.getGroupMembers = function(gid, callback, members, link
if (!link) {
if (typeof gid !== 'string') {
// It's a SteamID object
link = "http://steamcommunity.com/gid/" + gid.toString() + "/memberslistxml/?xml=1";
link = "https://steamcommunity.com/gid/" + gid.toString() + "/memberslistxml/?xml=1";
} else {
try {
var sid = new SteamID(gid);
if (sid.type == SteamID.Type.CLAN && sid.isValid()) {
link = "http://steamcommunity.com/gid/" + sid.getSteamID64() + "/memberslistxml/?xml=1";
link = "https://steamcommunity.com/gid/" + sid.getSteamID64() + "/memberslistxml/?xml=1";
} else {
throw new Error("Doesn't particularly matter what this message is");
}
} catch (e) {
link = "http://steamcommunity.com/groups/" + gid + "/memberslistxml/?xml=1";
link = "https://steamcommunity.com/groups/" + gid + "/memberslistxml/?xml=1";
}
}
}

View File

@@ -590,7 +590,7 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
},
"qs": {
"l": language, // Default language
"count": 2000, // Max items per 'page'
"count": 5000, // Max items per 'page'
"start_assetid": start
},
"json": true

1
examples/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
twofactor_*.json

View File

@@ -154,16 +154,20 @@ SteamCommunity.prototype._setCookie = function(cookie, secure) {
var protocol = secure ? "https" : "http";
cookie.secure = !!secure;
this._jar.setCookie(cookie.clone(), protocol + "://steamcommunity.com");
this._jar.setCookie(cookie.clone(), protocol + "://store.steampowered.com");
this._jar.setCookie(cookie.clone(), protocol + "://help.steampowered.com");
if (cookie.domain) {
this._jar.setCookie(cookie.clone(), protocol + '://' + cookie.domain);
} else {
this._jar.setCookie(cookie.clone(), protocol + "://steamcommunity.com");
this._jar.setCookie(cookie.clone(), protocol + "://store.steampowered.com");
this._jar.setCookie(cookie.clone(), protocol + "://help.steampowered.com");
}
};
SteamCommunity.prototype.setCookies = function(cookies) {
cookies.forEach((cookie) => {
var cookieName = cookie.match(/(.+)=/)[1];
var cookieName = cookie.trim().split('=')[0];
if (cookieName == 'steamLogin' || cookieName == 'steamLoginSecure') {
this.steamID = new SteamID(cookie.match(/=(\d+)/)[1]);
this.steamID = new SteamID(cookie.match(/steamLogin(Secure)?=(\d+)/)[2]);
}
this._setCookie(Request.cookie(cookie), !!(cookieName.match(/^steamMachineAuth/) || cookieName.match(/Secure$/)));

View File

@@ -1,6 +1,6 @@
{
"name": "steamcommunity",
"version": "3.48.0",
"version": "3.48.4",
"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.6.0",
"steam-session": "^1.7.2",
"steam-totp": "^1.5.0",
"steamid": "^1.1.3",
"xml2js": "^0.6.2"