Jump to content
McKay Development

What Comes Around

Member
  • Posts

    57
  • Joined

  • Last visited

Everything posted by What Comes Around

  1. Good news, works like a charm! Scraping data just fine now! Oh and it makes sense to me now. I looked through steam community at the constructor options and I didn't see any httpProxy options. Now I see there is a request option, but instead I pass in my own request default settings and that gets replaced by my passed in option. Do I understand this correctly?
  2. Yeah I have tried using wireshark before, but my networking knowledge is very lacking. I think the easiest way to get around this problem for me is to just use VM's that use proxies. Only issue with that is if I want information to converge, I will need to setup a webserver to manage the bots. That's not a big deal because I know how to code websites but I'm just wondering what would take more time, learning and finding the problem or making vm's and a webserver to converge the data. Issue is the longer it takes the more money I lose, so I think I will go with the easier option first, to patch things up, and then look into finding the problem with requests not going through a proxy. Just a side note; could it be possible that using community.httpRequestPost outside of it's constructor mean it doesn't inherit proxy settings? Because as far as I can tell, all of my bots are logging in from separate ip's (looking at the log in history on steam). And what's being rate limited in specific is getting item data from steam community, which I made my own function for using community.httpRequestPost. By the way, I'd like to mention, I am self taught in coding, because of this I only learned what I wanted/needed, so I'm sorry if I don't explain things very clearly or have naïve ideas.
  3. I am still getting rate limited, do you perhaps know any tools to perhaps bind http requests to so I can see which functions are making requests without going through a proxy?
  4. And is the same thing necessary for TradeOfferManager or does it inherit the proxy from client and community?
  5. Perfect! Thank you very much! I will see if that solves all my issues.
  6. Good day, I have bots that are scraping the CSGO market for new items and their prices. I have around 42 bot accounts doing this, every 5 bots have their own proxy ip. I assign the ip to the steam client. However, my actual ip is getting rate limited even though I don't use it much, so I guess the requests are going through the proxy. Here is the code with which I assign a proxy: let Client = { client: new SteamUser({ httpProxy: proxy, webCompatibilityMode: true }), community: new SteamCommunity(), manager: new TradeOfferManager({ steam: this.client, community: this.community, language: 'en' }) } Am I not using this correctly? How can I narrow down the issue? I am 100% sure it's because of my bots running, because when I turn them off and wait for a little while, my ip is no longer rate limited.
  7. Is there a way to get all the items on the steam market for CSGO? I have tried omitting query string and using '' (so nothing), but got back some error. I think it was there are no items with that keyword or something.
  8. Thanks! I appreciate the help Edit: I got everything figured out
  9. Good day, I have been trying to make a function that searches for a random item on the steam market, I ran into an issue. Here is the error: C:\Users\Ernest\Desktop\SteamBot\Current Version\node_modules\steamcommunity\classes\CMarketSearchResult.js:62 callback(new Error($errorMsg.text())); ^ TypeError: callback is not a function at SteamCommunity.<anonymous> (C:\Users\Ernest\Desktop\SteamBot\Current Version\node_modules\steamcommunity\classes\CMarketSearchResult.js:62:5) at Request._callback (C:\Users\Ernest\Desktop\SteamBot\Current Version\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (C:\Users\Ernest\Desktop\SteamBot\Current Version\node_modules\request\request.js:185:22) at Request.emit (events.js:315:20) at Request.<anonymous> (C:\Users\Ernest\Desktop\SteamBot\Current Version\node_modules\request\request.js:1154:10) at Request.emit (events.js:315:20) at Gunzip.<anonymous> (C:\Users\Ernest\Desktop\SteamBot\Current Version\node_modules\request\request.js:1076:12) at Object.onceWrapper (events.js:421:28) at Gunzip.emit (events.js:315:20) at endReadableNT (internal/streams/readable.js:1327:12) C:\Users\Ernest\Desktop\SteamBot\Current Version>pause Press any key to continue . . . Looking at the code here is what I see: function performSearch() { self.httpRequest({ "uri": "https://steamcommunity.com/market/search/render/", "qs": qs, "headers": { "referer": "https://steamcommunity.com/market/search" }, "json": true }, function(err, response, body) { if (err) { callback(err); return; } if(!body.success) { callback(new Error("Success is not true")); return; } if(!body.results_html) { callback(new Error("No results_html in response")); return; } var $ = Cheerio.load(body.results_html); var $errorMsg = $('.market_listing_table_message'); if($errorMsg.length > 0) { callback(new Error($errorMsg.text())); return; } var rows = $('.market_listing_row_link'); for(var i = 0; i < rows.length; i++) { results.push(new CMarketSearchResult($(rows))); } if(body.start + body.pagesize >= body.total_count) { callback(null, results); } else { qs.start += body.pagesize; performSearch(); } }, "steamcommunity"); } }; Here is my code: community.marketSearch(query, 730, false, function(err, items) { if (err) { console.log(err) } else { console.log(items) resolve(items); } }) }) I don't think there is anything wrong with my code, any ideas?
  10. Good news, well I mean the error still occurs but I know what's going on. And knowing is good . As you can see, while the error did look scary being displayed 5-10 times, all accounts do get successful requests from time to time. In fact, more often than not. So the fear factor was just a result of the scale I'm working in. I am not sure why this is the error I get instead of 502, but whatever, it's not catastrophic. Problem solved.
  11. I have looked at several ways I thought I could prevent this error, but I am still getting it. I cannot understand why it is happening. I have even made the client weblog() when the error occurs more than 10 times in succession. Still doesn't fix it. Do you know what this error could be? Because I cannot understand what the cause is.
  12. Oh I see, what happens in that case? Is there a similar property I could use for steamcommunity?
  13. Yes, I have a listener for the event and I check the steamID property. So the sessionExpired event gets handled, I don't understand why I am getting the error in that case. Here is my listener: community.on('sessionExpired', () => { information.steam_webservice_connection = 'disconnected'; log.info('LoginClient', `${user.username}'s websession expired!`) if (client.steamID == null) { log.info('LoginClient', `${user.username} was disconnected from steam! Relogging in.`) } else { client.webLogOn(); } }) So in this way if the websession is expired I log in again, otherwise it does nothing because I have relogging in enabled as default. Also I have a bit of code that checks the steam community steamID and steam client steamID to check if the user is connected: if (SteamClients[user].client.steamID == null || SteamClients[user].community.steamID == null) { connection = '\x1b[31mdisconnected\x1b[37m' } else { connection = '\x1b[32mconnected\x1b[37m' } and so far it seems the clients and webclients are always connected, unless steam is down. And keep in mind, as I am seeing all accounts connected, I am getting this error. So I thought it must be a cookies issue, that's why manager doesn't have access to the inventory, but then I have this listener: client.on('webSession', (sid, cookies) => { information.steam_webservice_connection = 'connected'; manager.setCookies(cookies); community.setCookies(cookies); hasWebSession = true; log.debug('LoginClient', `Client weblogged in ${user.username}`) if(isLoggedOn) { stratup = true; information.start_time = Date.now(); resolve() }; }) So if the client makes a new session (and it negotiates a websession) this event should fire. And if a new websession is established from the session expiration listener, this should fire. So, in any case manager's cookies should be up to date. So I really don't understand why I am getting this error. One more thing I should probably mention is these are my options for the manager constructor: manager: new TradeOfferManager({ steam: this.client, community: this.community, language: 'en' }) Would this perhaps need to be updated if a new client session/websession is established? I don't see why it should as the client and community constructors don't change, their sessions do but not the constructor themselves. But I just thought I should throw this out there.
  14. Good day! Recently I was surprised to find that my bots had inventories but looking at the logs they said they didn't have anything. So after enabling output settings I got to see the error. I am getting this error: Of course the Error in getting inventory part is my own. Here is my code for getting the inventory: function GetInventory(user){ return new Promise((resolve, reject) => { const { client, community, manager, details: { username, password, shared_secret, }, } = SteamClients[user.username]; manager.getInventoryContents(730, 2, false, (err, inventory) => { if (err) { log.debug('GetInventory', err) reject(err); } else { resolve(inventory); } }) }) } I am confused as to why this happens after some time of my bots running. I considered that maybe when the sessions expire the cookies for manager don't get reassigned, but they do. I webRelog when the websession expires, I have relog enabled (as default) and I have all the appropriate event listeners and manager's cookies are set on a new websession being established. So I don't understand why this is happening. Any ideas?
  15. Also, are the events 'loggedOn' and 'disconnected' directly tied to the state of client.steamID? Also, is client.steamID an accurate indicator of the client being connected? If I had to guess, client.steamID is returned by steam and is nullified when the connection is broken, and when the ID is returned (Client is connected) or there is a disconnection those events are emitted. Is my assumption correct?
  16. That's strange. Because based on my code I don't see how this should occur. Below I will include the only code that should relogin the user. community.on('sessionExpired', () => { log.info('LoginClient', `${user.username}'s websession expired!`) if (client.steamID == null) { log.info('LoginClient', `${user.username} was disconnected from steam! Relogging in.`) client.logOn({ accountName: username, password: password, rememberPassword: true, twoFactorCode: SteamTotp.generateAuthCode(shared_secret), }); } else { client.webLogOn(); } }) Let me know if you see anything wrong with this. Because unless client.steamID doesn't always return the correct login status, I don't see why this error should occur. Also, I should mention that before the code above was introduced, I wasn't getting the "already logged in" error. Edit: Thinking about it now, perhaps the issue is that when I log in via client.logOn I replace the session, and because I have relog turned on, it relogs in, causing this loop. Because I am getting 1000s of relogins and the Replaced Session error pops up as well. So if I had to guess that's the cause, and the fix would be to just not call logOn, let it do it's thing but once client.steamID is ! null,call client.webLogOn(). Anyways, that's just me guessing. I'd like to hear your thoughts on what's happening.
  17. I get this error from time to time: (node:31740) UnhandledPromiseRejectionWarning: Error: Already logged on, cannot log on again at C:\Users\Ernest\Desktop\Current Version\node_modules\steam-user\components\logon.js:23:10 at processTicksAndRejections (internal/process/task_queues.js:75:11) (node:31740) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3) Sometimes my bot experiences this error maybe times in a row. Worst case scenario I've seen it reoccur 100 times. Any idea what could be the cause of this issue? I found this while looking at the steam user npm: https://www.npmjs.com/package/steam-user#events-. At steamGuard I can see that you mention: "If you are using 2FA, you need to check the lastCodeWrong argument. If it's true, then the last code you provided was incorrect (likely already used). In this case, you should wait 30 seconds to allow the TOTP algorithm to generate a new code. Failure to do so will result in a login loop, causing your IP address to be temporarily banned.". Could this be the cause of the error?
  18. Perfect! Thank you! Also if I use the logOn() function, by default the webLogOn function is called too, right?
  19. C:\Users\Ernest\Desktop\SteamBot\node_modules\steam-user\components\web.js:10 throw new Error("Cannot log onto steamcommunity.com without first being connected to Steam network"); ^ Error: Cannot log onto steamcommunity.com without first being connected to Steam network at SteamUser.webLogOn (C:\Users\Ernest\Desktop\SteamBot\node_modules\steam-user\components\web.js:10:9) at SteamCommunity.<anonymous> (C:\Users\Ernest\Desktop\SteamBot\components\steamclient.js:73:20) at SteamCommunity.emit (events.js:315:20) at SteamCommunity._notifySessionExpired (C:\Users\Ernest\Desktop\SteamBot\node_modules\steamcommunity\components\http.js:85:7) at C:\Users\Ernest\Desktop\SteamBot\node_modules\steamcommunity\components\confirmations.js:21:10 at C:\Users\Ernest\Desktop\SteamBot\node_modules\steamcommunity\components\confirmations.js:272:4 at SteamCommunity._checkHttpError (C:\Users\Ernest\Desktop\SteamBot\node_modules\steamcommunity\components\http.js:90:3) at Request._callback (C:\Users\Ernest\Desktop\SteamBot\node_modules\steamcommunity\components\http.js:50:61) at self.callback (C:\Users\Ernest\Desktop\SteamBot\node_modules\request\request.js:185:22) at Request.emit (events.js:315:20) Function that triggers it: client.logOn({ accountName: username, password: password, rememberPassword: true, twoFactorCode: SteamTotp.generateAuthCode(shared_secret), }); client.on('loggedOn', ()=> { isLoggedOn = true; client.setPersona(1); log.debug('LoginClient', `Client logged in ${user.username}`) if(hasWebSession) resolve(); }) client.on('webSession', (sid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); hasWebSession = true; log.debug('LoginClient', `Client weblogged in ${user.username}`) if(isLoggedOn) resolve(); }) client.on('error', (err) => { log.error('LoginClient', `Client experienced an error ${user.username}`) log.error('LoginClient', err) }) community.on('sessionExpired', () => { log.info('LoginClient', `${user.username}'s websession expired!`) client.webLogOn(); }) community.on('sessionExpired', () => { log.info('LoginClient', `${user.username}'s websession expired!`) client.webLogOn(); }) Here is an error I am getting when checking for an expired session. Would it be possible to prevent this? I mean I think I could do something along the lines of try catching weblogOn, but do you perhaps have a better solution?
  20. Sorry for the late reply. I normally read a file, reads and splits the string (read from file) into an array of proxy objects, one of the properties is the number of clients. If the number of clients is more than lets say 10, take a different proxy and increase the client number for that proxy. Something like that.
  21. Thanks! This is the solution I was looking for!
  22. Good day! I get this error from time to time: ConfirmationChecker Error: Not Logged In at Request.init (D:\Node Projects\SteamMarketBot\node_modules\request\request.js:458:31) at Redirect.onResponse (D:\Node Projects\SteamMarketBot\node_modules\request\lib\redirect.js:149:11) at Request.onRequestResponse (D:\Node Projects\SteamMarketBot\node_modules\request\request.js:986:22) at ClientRequest.emit (events.js:315:20) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:641:27) at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17) at HTTPParser.execute (<anonymous>) at TLSSocket.socketOnData (_http_client.js:509:22) at TLSSocket.emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) What is strange is that the client is still connected in most cases. It still returns inventories, it still changes gamesPlayed but when accepting all confirmations, it gives me this error. So I am curious what I can do to fix the error.
×
×
  • Create New...