@unavatar/core 3.7.78 → 3.7.80

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.78",
5
+ "version": "3.7.80",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -2,4 +2,6 @@
2
2
 
3
3
  const uniqueRandomArray = require('unique-random-array')
4
4
 
5
- module.exports = uniqueRandomArray(require('top-crawler-agents'))
5
+ module.exports = uniqueRandomArray(
6
+ require('top-crawler-agents').filter(agent => agent.startsWith('Slackbot'))
7
+ )
@@ -87,16 +87,20 @@ module.exports = ({ PROXY_TIMEOUT, getHTML, onFetchHTML }) => {
87
87
  })
88
88
  error.html = attempt.lastHtml
89
89
 
90
- const { detected: antibotDetected } = isAntibot({
91
- url: providerUrl,
92
- headers: responseHeaders,
93
- body: attempt.lastHtml
94
- })
90
+ const { detected: antibotDetected, provider: antibotProvider } =
91
+ isAntibot({
92
+ url: providerUrl,
93
+ headers: responseHeaders,
94
+ body: attempt.lastHtml
95
+ })
96
+
95
97
  if (antibotDetected || isBlocked?.($) === true) error.blocked = true
96
98
 
97
99
  log.error({
98
100
  statusCode,
99
- status: error.blocked ? 'blocked' : undefined
101
+ status: error.blocked ? 'blocked' : undefined,
102
+ antibot: antibotProvider ?? undefined,
103
+ userAgent: fetchOpts.headers['user-agent']
100
104
  })
101
105
 
102
106
  throw error