-
Notifications
You must be signed in to change notification settings - Fork 8
CCL-7162 added new Captchas and fixed olds #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,20 @@ | ||
| import { TaskType } from '../../TaskType'; | ||
| import { AltchaRequestBase, AltchaRequestBaseIn } from './AltchaRequestBase'; | ||
| import { ProxyInfo, ProxyInfoIn } from '../ProxyInfo'; | ||
|
|
||
| export type AltchaRequestIn = Pick<AltchaRequestBaseIn, Exclude<keyof AltchaRequestBaseIn, 'type' | '_class'>> & { | ||
| proxy?: ProxyInfoIn; | ||
| }; | ||
| /** | ||
| * Altcha recognition request. | ||
| * {@link https://zenno.link/doc-altcha} | ||
| */ | ||
| export class AltchaRequest extends AltchaRequestBase { | ||
| constructor({ proxy, ...argsObj }: AltchaRequestIn) { | ||
| super({ type: TaskType.CustomTask, _class: 'altcha', ...argsObj }); | ||
|
|
||
| if (proxy) { | ||
| Object.assign(this, new ProxyInfo(proxy)); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,53 @@ | ||
| import { CaptchaRequestBase, CaptchaRequestBaseIn } from '../CaptchaRequestBase'; | ||
|
|
||
| export type AltchaRequestBaseIn = { | ||
| websiteURL: string; | ||
| userAgent?: string; | ||
| _class: string; | ||
| metadata: Metadata; | ||
| } & CaptchaRequestBaseIn; | ||
|
|
||
| export type Metadata = { | ||
| challenge: string; | ||
| iterations: string; | ||
| salt: string; | ||
| signature: string; | ||
| }; | ||
|
|
||
| /** | ||
| * Base Altcha recognition request | ||
| */ | ||
| export abstract class AltchaRequestBase extends CaptchaRequestBase { | ||
| /** | ||
| * Address of a webpage with DataDome. | ||
| */ | ||
| public websiteURL!: string; | ||
|
|
||
| /** | ||
| * Altcha website key. | ||
| */ | ||
| public websiteKey!: string; | ||
|
|
||
| /** | ||
| * The object that contains additional data about the captcha - challenge, iterations, salt, signature | ||
| */ | ||
| public metadata!: Metadata; | ||
|
|
||
| /** | ||
| * Browser User-Agent. Pass only the actual UA from Windows OS | ||
| */ | ||
| public userAgent?: string; | ||
|
|
||
| /** | ||
| * Class of captcha object | ||
| */ | ||
| public class: string; | ||
|
|
||
| constructor({ type, nocache, websiteURL, userAgent, metadata, _class }: AltchaRequestBaseIn) { | ||
| super({ type, nocache }); | ||
| this.websiteURL = websiteURL; | ||
| this.metadata = metadata; | ||
| this.userAgent = userAgent; | ||
| this.class = _class; | ||
| } | ||
| } |
This file contains hidden or 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 @@ | ||
| export * from './AltchaRequest'; |
This file contains hidden or 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 hidden or 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 hidden or 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
18 changes: 18 additions & 0 deletions
18
src/Requests/RecaptchaV3EnterpriseRequest/RecaptchaV3EnterpriseRequest.ts
This file contains hidden or 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,18 @@ | ||
| import { TaskType } from '../../TaskType'; | ||
| import { RecaptchaV3EnterpriseRequestBase, RecaptchaV3EnterpriseRequestBaseIn } from './RecaptchaV3EnterpriseRequestBase'; | ||
|
|
||
| export type RecaptchaV3EnterpriseRequestIn = Pick< | ||
| RecaptchaV3EnterpriseRequestBaseIn, | ||
| Exclude<keyof RecaptchaV3EnterpriseRequestBaseIn, 'type'> | ||
| >; | ||
|
|
||
| /** | ||
| * Recaptcha V3 Enterprise recognition request. | ||
| * {@link https://zenno.link/doc-recaptcha3e-proxy-en} | ||
| */ | ||
|
|
||
| export class RecaptchaV3EnterpriseRequest extends RecaptchaV3EnterpriseRequestBase { | ||
| constructor({ ...restArgsObj }: RecaptchaV3EnterpriseRequestIn) { | ||
| super({ type: TaskType.RecaptchaV3EnterpriseTask, ...restArgsObj }); | ||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
src/Requests/RecaptchaV3EnterpriseRequest/RecaptchaV3EnterpriseRequestBase.ts
This file contains hidden or 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,47 @@ | ||
| import { CaptchaRequestBase, CaptchaRequestBaseIn } from '../CaptchaRequestBase'; | ||
|
|
||
| export type RecaptchaV3EnterpriseRequestBaseIn = { | ||
| websiteURL: string; | ||
| websiteKey: string; | ||
| userAgent?: string; | ||
| minScore?: number; | ||
| pageAction?: string; | ||
| } & CaptchaRequestBaseIn; | ||
|
|
||
| /** | ||
| * Base Recaptcha V3 Enterprise recognition request | ||
| */ | ||
| export abstract class RecaptchaV3EnterpriseRequestBase extends CaptchaRequestBase { | ||
| /** | ||
| * Address of a webpage with Google ReCaptcha | ||
| */ | ||
| public websiteURL!: string; | ||
|
|
||
| /** | ||
| * The ReCaptcha v3 site key on the target page. | ||
| * https://www.google.com/recaptcha/enterprise.js?render=THIS_ONE | ||
| */ | ||
| public websiteKey!: string; | ||
|
|
||
| /** | ||
| * Browser's User-Agent which is used in emulation. | ||
| * It is required that you use a signature of a modern browser, | ||
| * otherwise Google will ask you to "update your browser". | ||
| */ | ||
| public userAgent?: string; | ||
|
|
||
| // The action name passed to grecaptcha.execute(). | ||
| public pageAction?: string; | ||
|
|
||
| // Can have a value from 0.1 to 0.9 | ||
| public minScore?: number; | ||
|
|
||
| constructor({ type, nocache, websiteURL, websiteKey, userAgent, pageAction, minScore }: RecaptchaV3EnterpriseRequestBaseIn) { | ||
| super({ type, nocache }); | ||
| this.websiteURL = websiteURL; | ||
| this.websiteKey = websiteKey; | ||
| this.userAgent = userAgent; | ||
| this.pageAction = pageAction; | ||
| this.minScore = minScore; | ||
| } | ||
| } | ||
This file contains hidden or 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 @@ | ||
| export * from './RecaptchaV3EnterpriseRequest'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.