Jump to content
McKay Development

Recommended Posts

Posted

Hi guys! I have a problem when i get callback on webSession event, few days ago everything works fine, but now when i try to execute my node js file and got message from my logger: Unable to set trade offer cookies: Error: HTTP error 429. What can be wrong? So trade offer manager sent too many requests to steam and after 5-7 seconds we have 429. 

client.on('webSession', function (sessionID, cookies) {
    client.setPersona(SteamUser.Steam.EPersonaState.Online);
    offers.setCookies(cookies, function (err){
        if (err) {
            logger.error('Unable to set trade offer cookies: '+err);
            process.exit(1);
        }
    });
});

In cookies i receive an array with next data: sessionid, steamLogin and steamLoginSecure. Any idea?

Posted

429 means that you've sent too many requests to Steam in a short time and you need to slow down.

Yeah, i know it. But how can i do it? I just use method of steam trade offer manager 'setCookies' inside webSession event and this method gives me too many requests error. As i know this method don't have additional arguments to slow down his requests. And as i said before few days ago everything works fine. Usually it takes milliseconds to set cookies.

Posted

Ok, here is my code, i cut it and try to test, but still the same error. Please look at it, mb you will have any idea about what going wrong.

let SteamUser = require('steam-user');
let TradeOfferManager = require('steam-tradeoffer-manager');
let config = require('./config.js'); //my config files here with username, password and other stuff
let totp = require('steam-totp');

function getAuthCode() {
    return totp.getAuthCode('mystuffhere');
}

let client = new SteamUser();
let offers = new TradeOfferManager({
    steam:        client,
    domain:       config.domain, 
    language:     "en", 
    pollInterval: 10000, 
    cancelTime:   300000 
});

client.logOn({
    accountName: config.username,
    password: config.password,
    twoFactorCode: getAuthCode()
});

client.on('loggedOn', function (details) {
    console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());
});

client.on('error', function (e) {
    console.log(e);
    process.exit(1);
});

client.on('webSession', function (sessionID, cookies) {
    console.log("Got web session");
    client.setPersona(SteamUser.Steam.EPersonaState.Online);
    offers.setCookies(cookies, function (err){
        if (err) {
            console.log('Unable to set trade offer cookies: '+err);
            process.exit(1);
        }
        console.log("Cookies set.  API Key: "+offers.apiKey);
    });
});

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...