Jessecar96 / SteamBot

Automated bot software for interacting with Steam Trade
http://scrap.tf
MIT License
1.34k stars 910 forks source link

Error to get item schema, steam api update #1126

Closed DemonAk closed 6 years ago

DemonAk commented 6 years ago

i think this error issue because steam update api and need to be fixed new urls https://api.steampowered.com/IEconItems_440/GetSchemaItems/v1/?key= https://api.steampowered.com/IEconItems_440/GetSchemaOverview/v1/?key=

ghost commented 6 years ago

I just tested this. The second link seems to load faster, however, both return the schema. I will keep an eye on this issue just in case I have experienced this before. [Edit] Just checked the two schemas, the overview has less information so it may not be compatible with this SteamBot.

DemonAk commented 6 years ago

yep, second link faster load but not full item schema. First link it's a full item schema divided into several pages, "next": 1150 1 https://api.steampowered.com/IEconItems_440/GetSchemaItems/v1/?key= 2 https://api.steampowered.com/IEconItems_440/GetSchemaItems/v1/?key=&start=1150 3 https://api.steampowered.com/IEconItems_440/GetSchemaItems/v1/?key=&start=8303 4 https://api.steampowered.com/IEconItems_440/GetSchemaItems/v1/?key=&start=9336 5 https://api.steampowered.com/IEconItems_440/GetSchemaItems/v1/?key=&start=30112

i found download schema here on 'python' maybe this will help https://gist.github.com/buddhapest/27c3896595703d7d71652d889f487be5

kilpkonn commented 6 years ago

I made quick fix for it, works fine for me. May need rewrite though.

https://github.com/kilpkonn/SteamBot/commit/3168473a5360a87808b13118f9d23ef660fe1116

DemonAk commented 6 years ago

It works, but where scheme is downloaded?. I can't find file "tf_schema.cache" in C:\Users\User\AppData\Local\Temp only directroy with file C:\Users\User\AppData\Local\Temp\MetadataAsSource\Path.cs

ghost commented 6 years ago

The schema should be cached into the Bin Folder (or the folder you are running the bot from). The file's name is "tf_schema.cache". Inside is where it contains all the information.

There is a massive difference. between the two APIs. Just compare the two and you will see the old schema (works fine as you already know, this is slower but only needs to be fetched when it is updated) has more information about items.

The change that needs making is if the API gives off anything other than the code 200 we load all of the data from the cached schema. This will fix all issues with the bot and will allow it to keep operating even when it goes down. The other option is, of course, to remove schema completely and rely upon one of the other steam APIs (let me check) to fetch the data.

Changing the schema won't fix the issue because when the TF2 API goes down, both of them will become unavailable.

ghost commented 6 years ago

I am just going to leave this question here for you to reply to. What information do you actually require for your bot to function? If you are not trading within TF2 or do not require TF2 information about the item you can ignore the schema completely.

One method of getting the information you might need is using the API seen here [Oops, sorry forgot you shouldn't use that one but instead] http://steamcommunity.com/inventory/PROFILEID/440/2?l=english&count=5000

ghost commented 6 years ago

@DemonAk Could you close this issue as the pull request has been merged?

Thanks