MrRobot Posted October 4, 2016 Report Posted October 4, 2016 (edited) Hello, I have a problem with my code when I am trying to login() and editProfile() more than one account at once. My script: var community = new SteamCommunity(); var activationProcess = setInterval(prepareActivation, 20000); function prepareActivation() { doLogin(usernames[n], passwords[n]); n++; } function doLogin(accountName, password, authCode, twoFactorCode, captcha) { community.login({ // Some data }, function(err, sessionID, cookies, steamguard) { console.log(community.steamID.getSteamID64()); editProfile(username); }); } function setupProfile(username) { community.editProfile({ 'name' : username, }, function(err) { if (err) { console.log('Failed to Edit Profile'); console.log(err); } }); }As you can see from code I am trying to change SteamCommunity name. I do it through interval because I have 5 accounts. I do not understand why, but I am able to edit profile only for the first account. After that I get this error: Failed to Edit Profile Error: HTTP error 302 at SteamCommunity.<anonymous> (/Users/newbie/Work/Tools/node-steam-community/node_modules/steamcommunity/components/profile.js:123:22) at Request._callback (/Users/newbie/Work/Tools/node-steam-community/node_modules/steamcommunity/components/http.js:67:15) at Request.self.callback (/Users/newbie/Work/Tools/node-steam-community/node_modules/request/request.js:187:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/Users/newbie/Work/Tools/node-steam-community/node_modules/request/request.js:1044:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Gunzip.<anonymous> (/Users/newbie/Work/Tools/node-steam-community/node_modules/request/request.js:965:12) at emitNone (events.js:91:20) I have no idea why It happens, because when I am trying other methods like joinGroup(), everything works fine. It will be great if someone could tell me the reason. Thank you very much. Edited October 4, 2016 by MrRobot Quote
Dr. McKay Posted October 4, 2016 Report Posted October 4, 2016 It doesn't look like you're checking the login error. Quote
MrRobot Posted October 4, 2016 Author Report Posted October 4, 2016 I just removed this part here and left only the most important parts and the basic idea. But as you can see I am logging SteamID: console.log(community.steamID.getSteamID64());And I see the correct one on console. And of course I tried with joinGroup() method, all 5 accounts successfully joined the group. When I am tried to use setupProfile(), It did not work, but I always saw "null" result. Quote
MrRobot Posted October 4, 2016 Author Report Posted October 4, 2016 (edited) I found the problem. Unfortunately I did not find a solution. I debugged these editProfile() requests and I got something like this: #1 Request: EndPoint:edit Url:/profiles/76561198470762397 Form: { sessionID: 'b7fc5c8cd58708f8122da81c', type: 'profileSave', weblink_1_title: '', weblink_1_url: '', weblink_2_title: '', weblink_2_url: '', weblink_3_title: '', weblink_3_url: '', personaName: 'Some title', real_name: '', country: '', state: '', city: '', customURL: '', summary: '', primary_group_steamid: '0' } #2 Request: On the second request I have correct Form, but I have the same URL./profiles/76561198470762397 The problem is that we cache profileURL and do not delete it after another login() function. I created a pull request with simple fix. Hope this will help somebody.https://github.com/DoctorMcKay/node-steamcommunity/pull/130 Edited October 4, 2016 by MrRobot Quote
Dr. McKay Posted October 4, 2016 Report Posted October 4, 2016 The problem is that we cache profileURL and do not delete it after another login() function. I created a pull request with simple fix. Hope this will help somebody.https://github.com/DoctorMcKay/node-steamcommunity/pull/130 Thanks, live in v3.27.1. MrRobot 1 Quote
rektbot Posted February 21, 2017 Report Posted February 21, 2017 (edited) I am seeing this 302 issue however the information is still being updated correctly. eg. name/customurl/avatar. go figure? function updateProfile() { // PROFILE SETTINGS--------------------------------------------------------- DEBUG && console.log("UPDPROF: Setting Name & CustomURL"); community.editProfile({ "name": accName, "customURL": accCustomURL, }, function(err){ if (err) { DEBUG && console.log("UPDPROF: Error Occured - " + err); accWithError = true; profileDone = true; } else { DEBUG && console.log("UPDPROF: Name & CustomURL Updated!"); profileDone = true; } }); Edited February 21, 2017 by rektbot Quote
rektbot Posted February 21, 2017 Report Posted February 21, 2017 Sure am. I'll just handle it for now since profiles are actually being created. Cheers. Quote
Recommended Posts
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.