This repository has been archived by the owner on May 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from pro-src/v4.0.0
* 4.0.0
- Loading branch information
Showing
24 changed files
with
1,599 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env node | ||
|
||
function solveReCAPTCHA (url, sitekey, callback) { | ||
// Here you do some magic with the sitekey provided by cloudscraper | ||
} | ||
|
||
function onCaptcha (options, response, body) { | ||
const captcha = response.captcha; | ||
// solveReCAPTCHA is a method that you should come up with and pass it href and sitekey, in return it will return you a reponse | ||
solveReCAPTCHA(response.request.uri.href, captcha.siteKey, (error, gRes) => { | ||
if (error) return void captcha.submit(error); | ||
captcha.form['g-recaptcha-response'] = gRes; | ||
captcha.submit(); | ||
}); | ||
} | ||
|
||
const cloudscraper = require('..').defaults({ onCaptcha }); | ||
var uri = process.argv[2]; | ||
cloudscraper.get({ uri: uri, headers: { cookie: 'captcha=1' } }).catch(console.warn).then(console.log); // eslint-disable-line promise/catch-or-return |
Oops, something went wrong.