这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Humanoid = require("humanoid-js");
let humanoid = new Humanoid();
humanoid.get("https://www.cloudflare-protected.com")
.then(res => {
console.log(res.body) // <!DOCTYPE html><html lang="en">...
console.log(res.body.toString()) // <!DOCTYPE html><html lang="en">...
})
.catch(err => {
console.error(err)
Expand All @@ -51,7 +51,7 @@ humanoid.get("https://canyoupwn.me")
humanoid.bypassJSChallenge(res)
.then(challengeResponse => {
// Note that challengeResponse.isChallengeSolved won't be set to true when doing manual bypassing.
console.log(challengeResponse.body) // <!DOCTYPE html><html lang="en">...
console.log(challengeResponse.body.toString()) // <!DOCTYPE html><html lang="en">...
})
}
)
Expand All @@ -64,7 +64,7 @@ humanoid.get("https://canyoupwn.me")
(async function() {
let humanoid = new Humanoid();
let response = await humanoid.sendRequest("www.cloudflare-protected.com")
console.log(response.body) // <!DOCTYPE html><html lang="en">...
console.log(response.body.toString()) // <!DOCTYPE html><html lang="en">...
}())
```
### Humanoid API Methods
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "humanoid-js",
"version": "1.0.1",
"version": "1.0.2",
"description": "Node.js package to bypass WAF anti-bot JavaScript challenges",
"repository": {
"type": "git",
Expand Down
1 change: 0 additions & 1 deletion src/humanoidReqHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class HumanoidReqHandler {
let res = await rpn(url, currConfig);
// Decompress Brotli content-type if returned (Unsupported natively by `request`)
res = res.headers["content-encoding"] === "br" ? await this._decompressBrotli(res) : res;
res.body = res.body.toString();

if (this.isCaptchaInResponse(res.body)) {
throw Error("CAPTCHA page encountered. Cannot perform bypass.")
Expand Down