@unavatar/core 3.9.5 → 3.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@unavatar/core",
3
3
  "description": "Get unified user avatar from social networks, including Instagram, SoundCloud, Telegram, Twitter, YouTube & more.",
4
4
  "homepage": "https://unavatar.io",
5
- "version": "3.9.5",
5
+ "version": "3.9.7",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -120,32 +120,32 @@
120
120
  "@keyvhq/memoize": "~2.1.16",
121
121
  "@keyvhq/multi": "~2.1.15",
122
122
  "@keyvhq/offline": "~2.2.0",
123
- "@keyvhq/redis": "~2.1.15",
123
+ "@keyvhq/redis": "~2.1.17",
124
124
  "@metascraper/helpers": "~5.50.0",
125
125
  "@microlink/mql": "~0.15.1",
126
126
  "@microlink/ping-url": "~1.4.16",
127
- "browserless": "~10.12.0",
127
+ "browserless": "~10.12.5",
128
128
  "cacheable-lookup": "~6.1.0",
129
129
  "data-uri-regex": "~0.1.4",
130
- "debug-logfmt": "~1.4.7",
130
+ "debug-logfmt": "~1.4.10",
131
131
  "got": "~11.8.6",
132
- "html-get": "~2.22.0",
132
+ "html-get": "~2.22.2",
133
133
  "https-tls": "~1.0.24",
134
134
  "ipaddr.js": "~2.3.0",
135
135
  "is-absolute-url": "~3.0.3",
136
136
  "is-antibot": "~1.5.0",
137
137
  "is-email-like": "~1.0.0",
138
- "lodash": "~4.17.23",
138
+ "lodash": "~4.18.1",
139
139
  "ms": "~2.1.3",
140
140
  "p-any": "~3.0.0",
141
141
  "p-timeout": "~4.1.0",
142
142
  "puppeteer": "~24.40.0",
143
143
  "re2": "~1.24.0",
144
144
  "srcset": "~4.0.0",
145
- "stable-regex": "~1.0.0",
146
- "tangerine": "~2.1.0",
147
- "top-crawler-agents": "~1.0.34",
148
- "top-user-agents": "~2.1.95",
145
+ "stable-regex": "~1.0.1",
146
+ "tangerine": "~2.1.3",
147
+ "top-crawler-agents": "~1.0.35",
148
+ "top-user-agents": "~2.1.104",
149
149
  "ua-hints": "~1.0.1",
150
150
  "unique-random-array": "~2.0.0",
151
151
  "url-regex-safe": "~4.0.0"
@@ -110,14 +110,20 @@ module.exports = ({ PROXY_TIMEOUT, getHTML, onFetchHTML }) => {
110
110
  }
111
111
  })
112
112
 
113
- const { detected: antibotDetected, provider: antibotProvider } =
114
- isAntibot({
115
- url: providerUrl,
116
- headers: responseHeaders,
117
- body: attempt.lastHtml
118
- })
113
+ const isRateLimited = statusCode === httpStatus.TOO_MANY_REQUESTS
119
114
 
120
- if (antibotDetected || isBlocked?.($) === true) error.blocked = true
115
+ const { detected: antibotDetected, provider: antibotProvider } =
116
+ isRateLimited
117
+ ? { detected: false, provider: null }
118
+ : isAntibot({
119
+ url: providerUrl,
120
+ headers: responseHeaders,
121
+ body: attempt.lastHtml
122
+ })
123
+
124
+ if (isRateLimited || antibotDetected || isBlocked?.($) === true) {
125
+ error.blocked = true
126
+ }
121
127
 
122
128
  log.error({
123
129
  statusCode,