unprint 0.17.3 → 0.17.4

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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/package.json +1 -1
  3. package/src/app.js +6 -1
package/README.md CHANGED
@@ -18,6 +18,10 @@ unprint.options({
18
18
  concurrency: 10,
19
19
  interval: 10, // ms
20
20
  },
21
+ browser: {
22
+ concurrency: 5,
23
+ interval: 20,
24
+ },
21
25
  [hostname]: {
22
26
  enable: true, // enabled by default
23
27
  concurrency: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unprint",
3
- "version": "0.17.3",
3
+ "version": "0.17.4",
4
4
  "description": "Simplify common web scraping tasks while staying in control of the data.",
5
5
  "main": "src/app.js",
6
6
  "scripts": {},
package/src/app.js CHANGED
@@ -21,6 +21,10 @@ const settings = {
21
21
  interval: 10,
22
22
  concurrency: 10,
23
23
  },
24
+ browser: {
25
+ interval: 20,
26
+ concurrency: 5,
27
+ },
24
28
  },
25
29
  };
26
30
 
@@ -988,7 +992,7 @@ function getLimiterValue(prop, options, hostname) {
988
992
  return options.limits[hostname][prop];
989
993
  }
990
994
 
991
- return options.limits.default[prop];
995
+ return options.limits[options?.limiter || 'default'][prop];
992
996
  }
993
997
 
994
998
  function getLimiter(url, options) {
@@ -1125,6 +1129,7 @@ async function browserRequest(url, customOptions = {}) {
1125
1129
  timeout: 1000,
1126
1130
  extract: true,
1127
1131
  scope: 'main',
1132
+ limiter: 'browser',
1128
1133
  url,
1129
1134
  }, globalOptions, customOptions]);
1130
1135