diff --git a/index.js b/index.js index 35b36e6..911498d 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,9 @@ +const {chrome} = require('@doctormckay/user-agents'); const Request = require('request'); const SteamID = require('steamid'); const Helpers = require('./components/helpers.js'); -const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"; - require('util').inherits(SteamCommunity, require('events').EventEmitter); module.exports = SteamCommunity; @@ -29,7 +28,7 @@ function SteamCommunity(options) { "timeout": options.timeout || 50000, "gzip": true, "headers": { - "User-Agent": options.userAgent || USER_AGENT + "User-Agent": options.userAgent || chrome() } }; diff --git a/package.json b/package.json index a0d8b67..0324a0d 100644 --- a/package.json +++ b/package.json @@ -28,11 +28,12 @@ "url": "https://github.com/DoctorMcKay/node-steamcommunity.git" }, "dependencies": { + "@doctormckay/user-agents": "^1.0.0", "async": "^2.6.3", "cheerio": "0.22.0", "image-size": "^0.8.2", "request": "^2.88.0", - "steam-session": "^1.5.0", + "steam-session": "^1.6.0", "steam-totp": "^1.5.0", "steamid": "^1.1.3", "xml2js": "^0.6.2"