antibotbrowser 3.0.3 → 3.0.5
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/README.md +13 -5
- package/index.js +20 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@ This is for educational purposes only. Bypassing systems like bot verification m
|
|
|
5
5
|
|
|
6
6
|
>**Note:** This package is compatible with **Puppeteer**, **Playwright**, and any other automation framework that supports the Chrome DevTools Protocol (CDP).
|
|
7
7
|
|
|
8
|
+
Taktik p
|
|
9
|
+
|
|
8
10
|
# Usage
|
|
9
11
|
## 1 - First let's start by installing the module
|
|
10
12
|
```
|
|
@@ -56,6 +58,13 @@ const puppeteer = require('puppeteer');
|
|
|
56
58
|
})();
|
|
57
59
|
```
|
|
58
60
|
|
|
61
|
+
## Troubleshooting and General Information
|
|
62
|
+
- **Linux / Server Usage:** If you are running on a Linux server without a GUI (e.g., Ubuntu Server), you must use the `headless: true` option.
|
|
63
|
+
- **Root User:** If you are running the script as a `root` user, Chromium may fail to start due to security restrictions. In this case, use the `nosandbox: true` option.
|
|
64
|
+
- **Port Conflicts:** If the default port `9222` is already in use by another application, you can specify a different port using the `port` option (e.g., `9333`).
|
|
65
|
+
- **Dependencies:** Ensure that your system has the necessary dependencies installed for Chromium to run (especially on minimal Linux distributions).
|
|
66
|
+
|
|
67
|
+
|
|
59
68
|
## Example uses
|
|
60
69
|
```js
|
|
61
70
|
const antibotbrowser = require("antibotbrowser");
|
|
@@ -76,11 +85,6 @@ const puppeteer = require('puppeteer');
|
|
|
76
85
|
})();
|
|
77
86
|
```
|
|
78
87
|
|
|
79
|
-
## Troubleshooting and General Information
|
|
80
|
-
- **Linux / Server Usage:** If you are running on a Linux server without a GUI (e.g., Ubuntu Server), you must use the `headless: true` option.
|
|
81
|
-
- **Root User:** If you are running the script as a `root` user, Chromium may fail to start due to security restrictions. In this case, use the `nosandbox: true` option.
|
|
82
|
-
- **Port Conflicts:** If the default port `9222` is already in use by another application, you can specify a different port using the `port` option (e.g., `9333`).
|
|
83
|
-
- **Dependencies:** Ensure that your system has the necessary dependencies installed for Chromium to run (especially on minimal Linux distributions).
|
|
84
88
|
|
|
85
89
|
### Usage with Playwright
|
|
86
90
|
```js
|
|
@@ -101,3 +105,7 @@ const antibotbrowser = require("antibotbrowser");
|
|
|
101
105
|
console.log("Page title:", await page.title());
|
|
102
106
|
})();
|
|
103
107
|
```
|
|
108
|
+
|
|
109
|
+
## Important Notes
|
|
110
|
+
Regarding imitation and fake packages:
|
|
111
|
+
I've seen a few people publishing exact copies of our npm package under different names. Using these packages could pose security risks. Always use the original package developed by Nokersoft. (If you search for "antibotbrowser" in npm, you might find fake npm packages. Be careful and report them.)
|
package/index.js
CHANGED
|
@@ -8,6 +8,16 @@ const path = require('path');
|
|
|
8
8
|
// github.com/reloxe
|
|
9
9
|
// nokersoft.com
|
|
10
10
|
|
|
11
|
+
const tempProfiles = new Set();
|
|
12
|
+
const cleanAll = () => {
|
|
13
|
+
tempProfiles.forEach(p => {
|
|
14
|
+
try { if (fs.existsSync(p)) fs.rmSync(p, { recursive: true, force: true }); } catch (e) { }
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
process.on('exit', cleanAll);
|
|
19
|
+
['SIGINT', 'SIGTERM', 'SIGHUP'].forEach(sig => process.on(sig, () => process.exit()));
|
|
20
|
+
|
|
11
21
|
versioncehck();
|
|
12
22
|
async function versioncehck() {
|
|
13
23
|
try {
|
|
@@ -34,6 +44,10 @@ async function startbrowser(options) {
|
|
|
34
44
|
}
|
|
35
45
|
const tempProfile = path.join(baseDir, profileName);
|
|
36
46
|
|
|
47
|
+
if (!userdata) {
|
|
48
|
+
tempProfiles.add(tempProfile);
|
|
49
|
+
}
|
|
50
|
+
|
|
37
51
|
var args = [
|
|
38
52
|
'--remote-debugging-port=' + port,
|
|
39
53
|
'--user-data-dir=' + tempProfile
|
|
@@ -44,7 +58,12 @@ async function startbrowser(options) {
|
|
|
44
58
|
|
|
45
59
|
try {
|
|
46
60
|
execFile(chromium.path, args, (err) => {
|
|
47
|
-
if (
|
|
61
|
+
if (!userdata) {
|
|
62
|
+
try {
|
|
63
|
+
fs.rmSync(tempProfile, { recursive: true, force: true });
|
|
64
|
+
tempProfiles.delete(tempProfile);
|
|
65
|
+
} catch (e) { }
|
|
66
|
+
}
|
|
48
67
|
});
|
|
49
68
|
} catch (e) { }
|
|
50
69
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antibotbrowser",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Opening Chromium opens a real browser without bot validations in automated systems like Puppeteer. To avoid problems in places like Cloudflare",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|