简体   繁体   English

如何解析无限制的Steam用户库存

[英]How to parse steam user inventory without bans

If I will use standart link to parse Steam user inventory 如果我将使用standart链接来解析Steam用户清单
( https://steamcommunity.com/profiles/ { steamid } /inventory/json/730/2) https://steamcommunity.com/profiles/ {steamid} / inventory / json / 730/2)
more than 2-3 times per minute, I will get banned from Steam api to 5 mins. 每分钟超过2-3次,我将被Steam api禁止5分钟。 How can I parse it without bans? 我如何在没有禁止的情况下进行解析? Using node.js. 使用node.js。

Store the result you get from your first request, and re-use it instead of re-querying Steam every time you want to read the data. 存储您从第一个请求中获得的结果,然后重新使用它,而不是每次要读取数据时都重新查询Steam。
pseudocode: 伪代码:

if(!cache) 
    getDataFromSteam()
    saveDataToCache()
else
    getDataFromCache()

If you send too many requests you are sending too many requests. 如果发送太多请求,则发送太多请求。 That is a fact you have to accept and work with that. 这是您必须接受并与之合作的事实。 I know from testing on my own that you are limited to 200 calls in 5 minutes. 通过我自己进行的测试,我知道您在5分钟内只能打200个电话。 You have several options: 您有几种选择:

  • Implement a routine that limits the calls to 200 in 5 minutes and not more in order to avoid getting banned. 实施例行程序,将通话限制在5分钟内限制为200分钟,以免被禁止。
  • Cache the calls you make in order to avoid duplicate calls for one user. 缓存您进行的呼叫,以避免一个用户重复呼叫。
  • Use other IP adresses as mentioned by @Dandavis. 使用@Dandavis提到的其他IP地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM