html-get 2.9.2 → 2.9.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### 2.9.6 (2021-10-25)
6
+
7
+ ### [2.9.5](https://github.com/microlinkhq/html-get/compare/v2.9.4...v2.9.5) (2021-09-08)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * ensure reponse is a buffer ([842ed98](https://github.com/microlinkhq/html-get/commit/842ed98f713be107ee7a4b945d89e60376df6209))
13
+
14
+ ### [2.9.4](https://github.com/microlinkhq/html-get/compare/v2.9.3...v2.9.4) (2021-09-08)
15
+
16
+ ### 2.9.3 (2021-09-04)
17
+
5
18
  ### 2.9.2 (2021-08-16)
6
19
 
7
20
  ### 2.9.1 (2021-08-03)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "html-get",
3
3
  "description": "Get the HTML from any website, using prerendering when is necessary.",
4
4
  "homepage": "https://nicedoc.com/microlinkhq/html-get",
5
- "version": "2.9.2",
5
+ "version": "2.9.6",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
8
  "html-get": "bin/index.js"
@@ -29,14 +29,14 @@
29
29
  "request"
30
30
  ],
31
31
  "dependencies": {
32
- "@metascraper/helpers": "~5.24.0",
33
- "cheerio": "~1.0.0-rc.9",
32
+ "@metascraper/helpers": "~5.25.0",
33
+ "cheerio": "~1.0.0-rc.10",
34
34
  "css-url-regex": "~4.0.0",
35
35
  "debug-logfmt": "~1.0.4",
36
36
  "execall": "~2.0.0",
37
37
  "got": "~11.8.2",
38
38
  "html-encode": "~2.1.6",
39
- "html-urls": "~2.4.22",
39
+ "html-urls": "~2.4.26",
40
40
  "is-html-content": "~1.0.0",
41
41
  "lodash": "~4.17.21",
42
42
  "minimist": "~1.2.5",
@@ -44,8 +44,8 @@
44
44
  "p-retry": "~4.6.0",
45
45
  "replace-string": "~3.1.0",
46
46
  "time-span": "~4.0.0",
47
- "tldts": "~5.7.38",
48
- "top-sites": "~1.1.40",
47
+ "tldts": "~5.7.42",
48
+ "top-sites": "~1.1.63",
49
49
  "write-json-file": "~4.3.0"
50
50
  },
51
51
  "devDependencies": {
@@ -1,37 +1,37 @@
1
1
  [
2
- "apple",
3
- "youtube",
4
2
  "google",
3
+ "youtube",
4
+ "apple",
5
5
  "microsoft",
6
- "wikipedia",
7
6
  "wordpress",
8
- "vimeo",
7
+ "wikipedia",
9
8
  "github",
10
- "bbc",
9
+ "vimeo",
11
10
  "blogspot",
12
11
  "imdb",
13
- "slideshare",
14
12
  "nytimes",
13
+ "bbc",
15
14
  "theguardian",
16
- "huffingtonpost",
17
- "pinterest",
15
+ "slideshare",
18
16
  "telegraph",
17
+ "pinterest",
18
+ "huffingtonpost",
19
19
  "soundcloud",
20
- "eventbrite",
21
- "spotify",
22
- "yelp",
23
20
  "stackoverflow",
21
+ "eventbrite",
24
22
  "zoom",
23
+ "yelp",
25
24
  "techcrunch",
26
- "engadget",
25
+ "spotify",
27
26
  "theverge",
28
- "imgur",
29
- "csdn",
27
+ "engadget",
30
28
  "digg",
29
+ "csdn",
31
30
  "etsy",
32
31
  "flickr",
33
32
  "ghost",
34
33
  "giphy",
34
+ "imgur",
35
35
  "meetup",
36
36
  "producthunt",
37
37
  "reddit",
package/src/index.js CHANGED
@@ -20,9 +20,9 @@ const fetch = (
20
20
  ) =>
21
21
  new PCancelable(async (resolve, reject, onCancel) => {
22
22
  const req = got(url, {
23
- responseType: 'buffer',
24
23
  timeout: reflect ? timeout / 2 : timeout,
25
- ...opts
24
+ ...opts,
25
+ responseType: 'buffer'
26
26
  })
27
27
 
28
28
  onCancel.shouldReject = false
@@ -67,8 +67,8 @@ const prerender = async (
67
67
  fetchRes = fetch(url, {
68
68
  reflect: true,
69
69
  toEncode,
70
- headers,
71
70
  ...gotOpts,
71
+ headers,
72
72
  timeout
73
73
  })
74
74
  const browserless = await getBrowserless()
@@ -85,7 +85,11 @@ const prerender = async (
85
85
  statusCode: response.status()
86
86
  }
87
87
  },
88
- { timeout, headers }
88
+ {
89
+ timeout,
90
+ headers,
91
+ abortTypes: ['stylesheet', 'fonts', 'image', 'media']
92
+ }
89
93
  )
90
94
 
91
95
  const payload = await getPayload(url, opts)
@@ -158,7 +162,9 @@ module.exports = async (
158
162
  } = {}
159
163
  ) => {
160
164
  if (!getBrowserless) {
161
- throw TypeError('Need to provide a `getBrowserless` function. Try to pass `getBrowserless: require(\'browserless\')`')
165
+ throw TypeError(
166
+ "Need to provide a `getBrowserless` function. Try to pass `getBrowserless: require('browserless')`"
167
+ )
162
168
  }
163
169
 
164
170
  const toEncode = htmlEncode(encoding)