Giter Site home page Giter Site logo

csfloat / inspect Goto Github PK

View Code? Open in Web Editor NEW
383.0 383.0 117.0 1 MB

Source Code that Powers the CSFloat Inspect Link API

Home Page: https://csgofloat.com

License: MIT License

JavaScript 98.92% Dockerfile 0.54% Shell 0.54%
api backend bot csgo mongodb node

inspect's People

Contributors

alamer99 avatar bmwalters avatar citrinate avatar dependabot[bot] avatar helyux avatar lyeskin avatar rijksdaalder avatar step7750 avatar wangxingzhen avatar wavpro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inspect's Issues

Some Items Have an Undefined Item Name

Try inspect this :) steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20M2084510415594025871A15682606578D14295004447383904395 - undefined | undefined (Field-Tested) I know why

Error: Valve's servers didn't reply in time

Hi, i have this error:
{'code': 4, 'error': "Valve's servers didn't reply in time"}
How i can fix this? Thanks.
info: Updating Game Files... info: Logging in lightoox13smurf debug: lightoox13smurf Generating TOTP Code from shared_secret debug: lightoox13smurf About to connect info: Listening for HTTP on port: 80 error: Failed to fetch schema.json debug: Fetched items_game_cdn.txt info: lightoox13smurf Log on OK debug: Fetched csgo_english.txt debug: Fetched items_game.txt info: lightoox13smurf Initiating GC Connection info: lightoox13smurf CSGO Client Ready! debug: lightoox13smurf Fetching for 16510096052 debug: Received itemData for 16510096052 warn: Request Timeout for 16510096052 warn: Job Failed! S: 0 A: 16510096052 D: 14034956153617423917 M: 3246458172236441944 IP: ::ffff:127.0.0.1

RateLimitExceeded

I got more accounts and now getting this error for all the accounts:

error: Error logging in xxxxxxx: message=RateLimitExceeded, stack=Error: RateLimitExceeded
at SteamUser._handlers. (C:\Users\user\Desktop\project\FloatDB\node_modules\steam-user\components\logon.js:363:16)
at SteamUser._handleMessage (C:\Users\user\Desktop\project\FloatDB\node_modules\steam-user\components\messages.js:249:30)
at CMClient.emit (events.js:327:22)
at CMClient._netMsgReceived (C:\Users\user\Desktop\project\FloatDB\node_modules\steam-client\lib\cm_client.js:323:8)
at CMClient.handlers. (C:\Users\user\Desktop\procect\FloatDB\node_modules\steam-client\lib\cm_client.js:609:8)
at CMClient._netMsgReceived (C:\Users\user\Desktop\project\FloatDB\node_modules\steam-client\lib\cm_client.js:305:24)
at TCPConnection.emit (events.js:315:20)
at TCPConnection.readPacket (C:\Users\user\Desktop\project\FloatDB\node_modules\steam-client\lib\tcp_connection.js:183:7)
at Socket.emit (events.js:315:20)
at emitReadable
(_stream_readable.js:556:12), eresult=84

Request Timeouts after X float requests

Hey,
For a few days now I get request timeouts all the time after I pulled some item data. It looks like I'm getting rate limited after a certain threshold of requests. I used the standard request delay of 1100ms per bot, but used 10-20 bot accounts which often request 10-20 floats at the same second.
Do I need to get proxies to request floats simultaneously? How many requests can I send at the same time without getting rate limited? Or should I delay the requests and send them out successively? Do you happen to know the thresholds?

Thanks!

killeatervalue and customname both are broken in the reply JSON

When getting a reply from the API for an item with either stattrak or a nametag, it seems like neither reply actually works. For the following skin;

steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198269207545A16664606974D16288577316842925439

We can see that "killeatervalue":0, but it should be 16208. The skin also has a nametag, but it seems that the customname is missing all together.

{"iteminfo":{"origin":4,"quality":9,"rarity":5,"a":"16664606974","d":"2909510241188187007","paintseed":389,"defindex":7,"paintindex":282,"stickers":[{"stickerId":4339,"slot":0,"wear":0.6896421313285828,"codename":"berlin2019_signature_sico","material":"berlin2019/sig_sico","name":"Sico | Berlin 2019"},{"stickerId":2780,"slot":1,"codename":"boston2018_signature_olofmeister","material":"boston2018/sig_olofmeister","name":"olofmeister | Boston 2018"},{"stickerId":2316,"slot":2,"codename":"krakow2017_signature_nothing","material":"krakow2017/sig_nothing","name":"n0thing | Krakow 2017"},{"stickerId":2692,"slot":3,"codename":"boston2018_signature_nbk_gold","material":"boston2018/sig_nbk_gold","name":"NBK- (Gold) | Boston 2018"}],"killeatervalue":0,"floatvalue":0.26375874876976013,"s":"76561198269207545","m":"0","imageurl":"http://media.steampowered.com/apps/730/icons/econ/default_generated/weapon_ak47_cu_ak47_cobra_light_large.7494bfdf4855fd4e6a2dbd983ed0a243c80ef830.png","min":0.1,"max":0.7,"weapon_type":"AK-47","item_name":"Redline","rarity_name":"Classified","quality_name":"StatTrak™","origin_name":"Crafted","wear_name":"Field-Tested","full_item_name":"StatTrak™ AK-47 | Redline (Field-Tested)"}}

JSON returns NULL paintseed when it should be zero

Hardened weapons seem to return a null paintseed when in fact it should be zero. For example try using the following link: steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198201280069A10365076007D12132744290367588729

UnhandledPromiseRejectionWarning

Hey,

i just tried the beta version of the API.
Sadly, i get following error, everytime i try to make an Inspect Request to the / Route.

(node:14868) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) (node:14868) 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: 2)

Node Version: 12
OS: Windows / Mac

Does anyone now where the issue is coming from?

Cheers,
Yannick

Missing sticker name

{ "stickerId": 242, "slot": 2, "codename": "dhw2014_dignitas_gold", "material": "dhw2014/dignitas_gold" },

Is missing a name, replicateable here

s-parameter

Individual proxy for each accounts

Is it possible to use proxy servers for accounts?
It would be great if we could ask them in this section.
{
'user': 'user',
'pass': 'proxy',
//'auth': '2FA_TOKEN_2',
'proxy': ''
},

how to get param

hello there,

steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S%owner_steamid%A%assetid%D16321860215213409153

this is one of my csgo item link got from steam api and i know s param is 76561202255233023,but what is a/d/m param ?

Return Formatted Full Item Name in API

The API should return the full item name such as "StatTrak™ M4A1-S | Blood Tiger (Minimal Wear)".

This could be constructed client side using the API's info, but it is a better solution to return it ourselves to prevent consumers from potentially buggy implementations.

incorrect or not handling of errors

Just found few servers gone down with this error:
Error: getaddrinfo EAI_AGAIN raw.githubusercontent.com:443
at Object._errnoException (util.js:1024:11)
at errnoException (dns.js:55:15)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)

I assume this has to do with not catching specific errors when doing http(s) requests

Add Names of Rarity and Quality Attributes

It is useful to know the name of the rarity and quality attributes such as whether the weapon is Souvenir or Prototype along with the rarity of Classified, Covert, Contraband etc...

Currently the API returns the rarity and quality index within the items_game file, but we can parse it and return the English attribute names.

TypeError: Cannot read property 'toBuffer' of null

C:\Users\Admin\Desktop\CSGOFloat-Inspect-master>node index.js info: Updating Game Files... info: Logging in sludgefudgeghgh info: Listening for HTTP on port: 3000 (node:8704) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Usenode --trace-warnings ...to show where the warning was created) info: Connected to the database internal/fs/utils.js:701 throw new ERR_INVALID_ARG_TYPE( ^ TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (36) at Object.writeFile (fs.js:1385:5) at FileStorage.saveFile.FileStorage.writeFile (C:\Users\Admin\Desktop\CSGOFloat-Inspect-master\node_modules\file-manager\index.js:68:5) at SteamUser._handlers.<computed> (C:\Users\Admin\Desktop\CSGOFloat-Inspect-master\node_modules\steam-user\components\logon.js:294:18) at SteamUser._handleMessage (C:\Users\Admin\Desktop\CSGOFloat-Inspect-master\node_modules\steam-user\components\messages.js:249:30) at CMClient.emit (events.js:326:22) at CMClient._netMsgReceived (C:\Users\Admin\Desktop\CSGOFloat-Inspect-master\node_modules\steam-client\lib\cm_client.js:323:8) at CMClient.handlers.<computed> (C:\Users\Admin\Desktop\CSGOFloat-Inspect-master\node_modules\steam-client\lib\cm_client.js:609:8) at CMClient._netMsgReceived (C:\Users\Admin\Desktop\CSGOFloat-Inspect-master\node_modules\steam-client\lib\cm_client.js:305:24) at TCPConnection.emit (events.js:314:20) at TCPConnection._readPacket (C:\Users\Admin\Desktop\CSGOFloat-Inspect-master\node_modules\steam-client\lib\tcp_connection.js:183:7) { code: 'ERR_INVALID_ARG_TYPE' }

Can't figure out what the issue is. All help is appreciated!

Bots won't login

I'm trying to log in 2 bots, but it keeps on returning invalid password.
The thing is that if I copy the login details from the config.js file directly into steam I can log into the bot without problem.

This is the log I get

{"level":"info","message":"Logging in #####","timestamp":"2020-08-20T10:29:52.544Z"}

{"level":"info","message":"Logging in #####","timestamp":"2020-08-20T10:29:52.551Z"}

{"message":"Error logging in #####:","stack":"Error: InvalidPassword\n at SteamUser._handlers.(anonymous function) (/usr/src/csgofloat/node_modules/steam-user/components/logon.js:363:16)\n at SteamUser._handleMessage (/usr/src/csgofloat/node_modules/steam-user/components/messages.js:249:30)\n at CMClient.emit (events.js:203:15)\n at CMClient._netMsgReceived (/usr/src/csgofloat/node_modules/steam-client/lib/cm_client.js:323:8)\n at CMClient.handlers.(anonymous function) (/usr/src/csgofloat/node_modules/steam-client/lib/cm_client.js:609:8)\n at CMClient._netMsgReceived (/usr/src/csgofloat/node_modules/steam-client/lib/cm_client.js:305:24)\n at TCPConnection.emit (events.js:198:13)\n at TCPConnection._readPacket (/usr/src/csgofloat/node_modules/steam-client/lib/tcp_connection.js:183:7)\n at Socket.emit (events.js:198:13)\n at emitReadable_ (_stream_readable.js:554:12)","eresult":5,"level":"error","timestamp":"2020-08-20T10:29:54.025Z"}

{"message":"Error logging in #####:","stack":"Error: InvalidPassword\n at SteamUser._handlers.(anonymous function) (/usr/src/csgofloat/node_modules/steam-user/components/logon.js:363:16)\n at SteamUser._handleMessage (/usr/src/csgofloat/node_modules/steam-user/components/messages.js:249:30)\n at CMClient.emit (events.js:203:15)\n at CMClient._netMsgReceived (/usr/src/csgofloat/node_modules/steam-client/lib/cm_client.js:323:8)\n at CMClient.handlers.(anonymous function) (/usr/src/csgofloat/node_modules/steam-client/lib/cm_client.js:609:8)\n at CMClient._netMsgReceived (/usr/src/csgofloat/node_modules/steam-client/lib/cm_client.js:305:24)\n at TCPConnection.emit (events.js:198:13)\n at TCPConnection._readPacket (/usr/src/csgofloat/node_modules/steam-client/lib/tcp_connection.js:183:7)\n at Socket.emit (events.js:198:13)\n at emitReadable_ (_stream_readable.js:554:12)","eresult":5,"level":"error","timestamp":"2020-08-20T10:29:54.032Z"}

I've also gotten the program to print the login details to the log so I could verify it was the correct information it got, and it all was correct.

{"error":"Valve's servers appear to be offline, please try again later","code":5}

Doesnt matter what I do, I always get this error.

Updating Game Files...
Logging in *****bot
*****bot Generating TOTP Code from shared_secret
*****bot About to connect
Listening for HTTP on port: 1739
Connected to the database
*****bot Connected
Fetched items_game_cdn.txt
Fetched csgo_english.txt
*****bot Log on OK
*****bot Received servers.
Fetched items_game.txt

Please help

Invalid arg type

Error:

(node:14312) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ...` to show where the warning was created)
debug: Fetched items_game_cdn.txt
debug: Fetched schema.json
internal/fs/utils.js:781
throw new ERR_INVALID_ARG_TYPE(
^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (68)
at Object.writeFile (fs.js:1436:5)
at FileStorage.saveFile.FileStorage.writeFile (C:\Users\makez\Desktop\Code\test\csgofloat\node_modules\file-manager\index.js:68:5)
at SteamUser._handlers. (C:\Users\makez\Desktop\Code\test\csgofloat\node_modules\steam-user\components\logon.js:294:18)
at SteamUser._handleMessage (C:\Users\makez\Desktop\Code\test\csgofloat\node_modules\steam-user\components\messages.js:249:30)
at CMClient.emit (events.js:327:22)
at CMClient._netMsgReceived (C:\Users\makez\Desktop\Code\test\csgofloat\node_modules\steam-client\lib\cm_client.js:323:8)
at CMClient.handlers. (C:\Users\makez\Desktop\Code\test\csgofloat\node_modules\steam-client\lib\cm_client.js:609:8)
at CMClient._netMsgReceived (C:\Users\makez\Desktop\Code\test\csgofloat\node_modules\steam-client\lib\cm_client.js:305:24)
at TCPConnection.emit (events.js:315:20)
at TCPConnection._readPacket (C:\Users\makez\Desktop\Code\test\csgofloat\node_modules\steam-client\lib\tcp_connection.js:183:7) {
code: 'ERR_INVALID_ARG_TYPE'
}`

Invalid Inspect Link Structure

i have used the following code to use your api

<?php
if(isset($_GET['url']) and ($_GET['url']) != '') {
    $inspecturl = $_GET['url'];
    $url2 = 'https://api.csgofloat.com/?url='.$inspecturl; 
    #echo $url;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, $url2);
    $result = curl_exec($ch);
    curl_close($ch);

    $obj = json_decode($result);
    if (isset($obj->iteminfo)){
       echo $obj->iteminfo->weapon_type . ' - '. $obj->iteminfo->item_name ;
       echo "<br>";
       echo $obj->iteminfo->floatvalue;
    }else{
       echo $result;
    }
} else
echo 'please enter inspect url';
?>

and it gives the response of Invalid Inspect Link Structure
when i tested the url to check if everything correct that url gave me the valid data however my code didnt

JSON does not include sticker's %

I am looking for an easy way to analyse an inspect link without having to open csgo or generate a screenshot... I just need a JSON and while your script does the job, it does not include the sticker's % :/

error this.steamClient.disconnect is not a function

info: Updating Game Files...
info: Logging in loginnamehere
/steambots/csgofloat/lib/bot.js:61
if (this.steamClient) this.steamClient.disconnect();
^

TypeError: this.steamClient.disconnect is not a function
at Bot.logIn (/steambots/csgofloat/lib/bot.js:61:48)
at BotController.addBot (/steambots/csgofloat/lib/bot_controller.js:14:13)
at Object. (/steambots/csgofloat/index.js:44:19)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)

Implement Docker Support

Adding a Dockerfile will make it much easier to spin up a self-contained instance without having to deal with environment.

Cant login in the bot.

Hello there,

I am install this project on my server. But I found The bot cant be login, I dont receive email code

[root@localhost api.csgotrade.cn]# node index.js
info: Updating Game Files...
info: Logging in bot1
debug: bot1 Generating TOTP Code from shared_secret
debug: bot1 About to connect
info: Logging in bot2
debug: bot2 About to connect
info: Listening for HTTP on port: 1739
info: Connected to the database
debug: Fetched items_game_cdn.txt
debug: Fetched csgo_english.txt
debug: Fetched items_game.txt

Protobuf Error?

Hello, I went to run this today for the first time, and am receiving an error:

user@server:~/csgofloat$ node index.js
info: Updating Game Files...
info: Logging in redacted
/home/user/csgofloat/node_modules/protobufjs/dist/protobuf.js:784
                throw e;
                ^

Error: Parse error at line 1: unexpected '404'
    at Parser.ProtoBuf.DotProto.ParserPrototype.parse (/home/user/csgofloat/node_modules/protobufjs/dist/protobuf.js:779:35)
    at Function.ProtoBuf.DotProto.Parser.parse (/home/user/csgofloat/node_modules/protobufjs/dist/protobuf.js:797:39)
    at Object.ProtoBuf.loadProto (/home/user/csgofloat/node_modules/protobufjs/dist/protobuf.js:5128:59)
    at Object.ProtoBuf.loadProtoFile (/home/user/csgofloat/node_modules/protobufjs/dist/protobuf.js:5174:52)
    at Object.<anonymous> (/home/user/csgofloat/node_modules/csgo/helpers/protos.js:14:10)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)

Attempted npm update:

user@server:~/csgofloat$ npm update
npm WARN [email protected] had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.

+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
added 47 packages from 42 contributors, removed 35 packages, updated 27 packages and moved 4 packages in 4.997s
user@server:~/csgofloat$ node index.js
info: Updating Game Files...
info: Logging in redacted
/home/user/csgofloat/node_modules/steam-resources/steam_language_parser/index.js:8
process.chdir(languagePath);
        ^

Error: ENOENT: no such file or directory, uv_chdir
    at Object.<anonymous> (/home/user/csgofloat/node_modules/steam-resources/steam_language_parser/index.js:8:9)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/user/csgofloat/node_modules/steam-resources/index.js:81:1)
    at Module._compile (module.js:653:30)

I'd be happy to provide any more information that you require!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.