@unavatar/core 3.9.6 → 3.9.8

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.6",
5
+ "version": "3.9.8",
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"
@@ -4,5 +4,6 @@ module.exports = ({ createHtmlProvider, getOgImage }) =>
4
4
  createHtmlProvider({
5
5
  name: 'instagram',
6
6
  url: input => `https://www.instagram.com/${input}`,
7
- getter: getOgImage
7
+ getter: getOgImage,
8
+ isBlocked: $ => $('title').text() === 'Login \u2022 Instagram'
8
9
  })
@@ -111,9 +111,10 @@ module.exports = ({ PROXY_TIMEOUT, getHTML, onFetchHTML }) => {
111
111
  })
112
112
 
113
113
  const isRateLimited = statusCode === httpStatus.TOO_MANY_REQUESTS
114
+ const providerBlocked = isBlocked?.($)
114
115
 
115
116
  const { detected: antibotDetected, provider: antibotProvider } =
116
- isRateLimited
117
+ isRateLimited || providerBlocked
117
118
  ? { detected: false, provider: null }
118
119
  : isAntibot({
119
120
  url: providerUrl,
@@ -121,7 +122,7 @@ module.exports = ({ PROXY_TIMEOUT, getHTML, onFetchHTML }) => {
121
122
  body: attempt.lastHtml
122
123
  })
123
124
 
124
- if (isRateLimited || antibotDetected || isBlocked?.($) === true) {
125
+ if (isRateLimited || providerBlocked || antibotDetected) {
125
126
  error.blocked = true
126
127
  }
127
128