@unavatar/core 3.9.30 → 3.9.31

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.30",
5
+ "version": "3.9.31",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
@@ -133,7 +133,7 @@
133
133
  "https-tls": "~1.0.24",
134
134
  "ipaddr.js": "~2.3.0",
135
135
  "is-absolute-url": "~3.0.3",
136
- "is-antibot": "~1.5.0",
136
+ "is-antibot": "~1.6.1",
137
137
  "is-email-like": "~1.0.0",
138
138
  "lodash": "~4.18.1",
139
139
  "ms": "~2.1.3",
@@ -4,6 +4,5 @@ module.exports = ({ createHtmlProvider, getOgImage }) =>
4
4
  createHtmlProvider({
5
5
  name: 'instagram',
6
6
  url: input => `https://www.instagram.com/${input}`,
7
- getter: getOgImage,
8
- isBlocked: ({ $ }) => $('title').text() === 'Login \u2022 Instagram'
7
+ getter: getOgImage
9
8
  })
@@ -1,7 +1,5 @@
1
1
  'use strict'
2
2
 
3
- const LINKEDIN_BLOCKED_STATUS = 999
4
-
5
3
  const getAvatarUrl = input => {
6
4
  const [first, second] = input.split(':')
7
5
  const type = second ? first : 'user'
@@ -14,8 +12,7 @@ module.exports = ({ createHtmlProvider, getOgImage }) =>
14
12
  createHtmlProvider({
15
13
  name: 'linkedin',
16
14
  url: getAvatarUrl,
17
- getter: getOgImage,
18
- isBlocked: ({ statusCode }) => statusCode === LINKEDIN_BLOCKED_STATUS
15
+ getter: getOgImage
19
16
  })
20
17
 
21
18
  module.exports.getAvatarUrl = getAvatarUrl
@@ -118,6 +118,7 @@ module.exports = ({ PROXY_TIMEOUT, getHTML, onFetchHTML }) => {
118
118
  ? { detected: false, provider: null }
119
119
  : isAntibot({
120
120
  url: providerUrl,
121
+ statusCode,
121
122
  headers: responseHeaders,
122
123
  body: attempt.lastHtml
123
124
  })