-
Notifications
You must be signed in to change notification settings - Fork 8
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 #20 from Bezzz23/task/CCL-4354
CCL-4354 added TenDI captcha, added Amazon Captcha recognition
- Loading branch information
Showing
17 changed files
with
382 additions
and
3 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
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,14 @@ | ||
import { TaskType } from '../TaskType'; | ||
import { AmazonRequestBase, AmazonRequestBaseIn } from './AmazonRequestBase'; | ||
|
||
export type AmazonProxylessRequestIn = Pick<AmazonRequestBaseIn, Exclude<keyof AmazonRequestBaseIn, 'type'>>; | ||
|
||
/** | ||
* Amazon recognition request (without proxy). | ||
* {@link https://zenno.link/doc-amazon} | ||
*/ | ||
export class AmazonProxylessRequest extends AmazonRequestBase { | ||
constructor(argsObj: AmazonProxylessRequestIn) { | ||
super({ type: TaskType.AmazonTaskProxyless, ...argsObj }); | ||
} | ||
} |
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,16 @@ | ||
import { Mixin } from 'ts-mixer'; | ||
import { TaskType } from '../TaskType'; | ||
import { AmazonRequestBase, AmazonRequestBaseIn } from './AmazonRequestBase'; | ||
import { ProxyInfo, ProxyInfoIn } from './ProxyInfo'; | ||
|
||
export type AmazonRequestIn = Pick<AmazonRequestBaseIn, Exclude<keyof AmazonRequestBaseIn, 'type'>> & ProxyInfoIn; | ||
|
||
/** | ||
* Amazon recognition request (without proxy). | ||
* {@link https://zenno.link/doc-amazon} | ||
*/ | ||
export class AmazonRequest extends Mixin(AmazonRequestBase, ProxyInfo) { | ||
constructor(argsObj: AmazonRequestIn) { | ||
super({ type: TaskType.AmazonTask, ...argsObj }); | ||
} | ||
} |
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,62 @@ | ||
import { CaptchaRequestBase, CaptchaRequestBaseIn } from './CaptchaRequestBase'; | ||
|
||
export type AmazonRequestBaseIn = { | ||
websiteURL: string; | ||
challengeScript: string; | ||
captchaScript: string; | ||
websiteKey: string; | ||
context: string; | ||
iv: string; | ||
cookieSolution?: boolean; | ||
} & CaptchaRequestBaseIn; | ||
|
||
/** | ||
* Base GeeTest recognition request | ||
*/ | ||
export abstract class AmazonRequestBase extends CaptchaRequestBase { | ||
/** | ||
* Address of the page on which the captcha is recognized | ||
*/ | ||
public websiteURL!: string; | ||
|
||
/** | ||
* Link to challenge.js | ||
*/ | ||
public challengeScript!: string; | ||
|
||
/** | ||
* Link to captcha.js | ||
*/ | ||
public captchaScript!: string; | ||
|
||
/** | ||
* A string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.key | ||
*/ | ||
public websiteKey!: string; | ||
|
||
/** | ||
* A string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.context | ||
*/ | ||
public context!: string; | ||
|
||
/** | ||
* A string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.iv | ||
*/ | ||
public iv!: string; | ||
|
||
/** | ||
* By default false. If you need to use cookies "aws-waf-token", specify the value true. Otherwise, what you will get in return is "captcha_voucher" and "existing_token". | ||
*/ | ||
public cookieSolution?: boolean = false; | ||
|
||
constructor({ type, nocache, websiteURL, challengeScript, captchaScript, websiteKey, context, iv, cookieSolution }: AmazonRequestBaseIn) { | ||
super({ type, nocache }); | ||
this.websiteURL = websiteURL; | ||
this.challengeScript = challengeScript; | ||
this.captchaScript = captchaScript; | ||
this.websiteKey = websiteKey; | ||
this.context = context; | ||
this.iv = iv; | ||
this.cookieSolution = cookieSolution; | ||
} | ||
} |
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
Oops, something went wrong.