@unavatar/core 3.7.73 → 3.7.74

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.7.73",
5
+ "version": "3.7.74",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -49,7 +49,11 @@ module.exports = ({ PROXY_TIMEOUT, getHTML, onFetchHTML }) => {
49
49
 
50
50
  const log = debug.duration({ ...context, tier })
51
51
 
52
- const { $, statusCode } = await getHTML(providerUrl, fetchOpts)
52
+ const {
53
+ $,
54
+ statusCode,
55
+ headers: responseHeaders = {}
56
+ } = await getHTML(providerUrl, fetchOpts)
53
57
 
54
58
  attempt.lastHtml =
55
59
  typeof $ === 'function' && typeof $.html === 'function'
@@ -75,6 +79,8 @@ module.exports = ({ PROXY_TIMEOUT, getHTML, onFetchHTML }) => {
75
79
  error.html = attempt.lastHtml
76
80
 
77
81
  const { detected: antibotDetected } = isAntibot({
82
+ url: providerUrl,
83
+ headers: responseHeaders,
78
84
  body: attempt.lastHtml
79
85
  })
80
86
  if (antibotDetected || isBlocked?.($) === true) error.blocked = true