2captcha-0.1.0.0: Haskell package for easy integration with the 2captcha API.
Safe HaskellNone
LanguageHaskell2010

TwoCaptcha.Internal.Types.Captcha

Synopsis

Documentation

type CaptchaId = Text Source #

The id of a captcha being solved.

type PollingInterval = Int Source #

Time in milliseconds in how often to request the answer.

type TimeoutDuration = Integer Source #

Time in milliseconds on when to timeout if the request takes too long.

captchaTimeout :: TimeoutDuration Source #

Default captcha timeout duration (120 seconds).

pollingInterval :: PollingInterval Source #

Default polling interval (10 seconds).

data Captcha Source #

Represents the request information required to solve a captcha.

Constructors

MkCaptcha 

parts :: Getter Captcha [Part] Source #

Convert the captcha's multipart form parameters into a [Part].

defaultCaptcha :: Captcha Source #

Default parameters for solving a captcha. Internal use only.

mkPartLens :: (Coercible Captcha a, IsString s) => Lens' Captcha [(Text, s)] -> Text -> Lens' a (Maybe s) Source #

Create a lens using the given field name for multipart forms.

mkPartTextLens :: Coercible Captcha a => Text -> Lens' a (Maybe Text) Source #

Create a lens using the given field name for multipart form texts.

mkPartFileLens :: Coercible Captcha a => Text -> Lens' a (Maybe FilePath) Source #

Create a lens using the given field name for multipart form files.

mkParamLens :: Coercible Captcha a => Text -> Lens' a (Maybe Text) Source #

Creates a lens using the given field name for query parameters.

mkParamLens' :: (Coercible Captcha a, Show b, Read b) => Text -> Lens' a (Maybe b) Source #

Create a lens using the given field name for type b with a Show and Read instance.

GOTCHA: Bool values translate to True or False. Use mkLensBool instead for bool lenses.

mkParamLensBool :: Coercible Captcha a => Text -> Lens' a (Maybe Bool) Source #

Create a lens using the given field name for bools.

The boolean values become:

class Coercible Captcha a => HasCaptchaLenses a where Source #

Lenses for constructing options for submit.

Minimal complete definition

Nothing

Methods

softId :: Lens' a (Maybe Int) Source #

Software developer id. Developers who integrate their software with 2captcha earn 10% of the user's spendings.

pingback :: Lens' a (Maybe Text) Source #

URL for pingback (callback) response that will be sent the answer to when the captcha is solved.

method :: Lens' a (Maybe Text) Source #

Type of captcha to solve.

Instances

Instances details
HasCaptchaLenses Captcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.Captcha

HasCaptchaLenses CapyCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.CapyCaptcha

HasCaptchaLenses CoordinateCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.CoordinateCaptcha

HasCaptchaLenses FunCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.FunCaptcha

HasCaptchaLenses GeeTestCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.GeeTestCaptcha

HasCaptchaLenses GridCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.GridCaptcha

HasCaptchaLenses HCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.HCaptcha

HasCaptchaLenses KeyCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.KeyCaptcha

HasCaptchaLenses NormalCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.NormalCaptcha

HasCaptchaLenses ReCaptchaV3 Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.ReCaptcha

HasCaptchaLenses ReCaptchaV2 Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.ReCaptcha

HasCaptchaLenses RotateCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.RotateCaptcha

HasCaptchaLenses TextCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.TextCaptcha

HasCaptchaLenses TikTokCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.TikTokCaptcha

class Coercible Captcha a => HasCommonCaptchaLenses a where Source #

Lenses for constructing options for submit and answer.

Minimal complete definition

Nothing

Methods

apiKey :: Lens' a (Maybe Text) Source #

Your 2captcha API key.

headerACAO :: Lens' a (Maybe Bool) Source #

If True, submit will include the Access-Control-Allow-Origin:* header in the response. Used for cross-domain AJAX requests in web applications.

Instances

Instances details
HasCommonCaptchaLenses Captcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.Captcha

HasCommonCaptchaLenses CaptchaRes Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.Captcha

HasCommonCaptchaLenses CapyCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.CapyCaptcha

HasCommonCaptchaLenses CoordinateCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.CoordinateCaptcha

HasCommonCaptchaLenses FunCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.FunCaptcha

HasCommonCaptchaLenses GeeTestCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.GeeTestCaptcha

HasCommonCaptchaLenses GridCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.GridCaptcha

HasCommonCaptchaLenses HCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.HCaptcha

HasCommonCaptchaLenses KeyCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.KeyCaptcha

HasCommonCaptchaLenses NormalCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.NormalCaptcha

HasCommonCaptchaLenses ReCaptchaV3 Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.ReCaptcha

HasCommonCaptchaLenses ReCaptchaV2 Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.ReCaptcha

HasCommonCaptchaLenses RotateCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.RotateCaptcha

HasCommonCaptchaLenses TextCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.TextCaptcha

HasCommonCaptchaLenses TikTokCaptcha Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.TikTokCaptcha

newtype CaptchaRes Source #

Parameters used to retrieve the answer of a solved captcha.

Constructors

CaptchaRes Captcha 

captchaRes :: CaptchaRes Source #

Parameters for retrieving a captcha's answer.

Required parameters:

Optional parameters:

captchaId :: Lens' CaptchaRes (Maybe Text) Source #

The captcha id returned from submit.

class Coercible Captcha a => HasProxy a where Source #

Minimal complete definition

Nothing

Methods

proxy :: Lens' a (Maybe Text) Source #

Proxy to be sent to the worker who solves the captcha. You can read more about proxies here.

Format must be in login:password@123.123.123.123:3128 .

proxyType :: Lens' a (Maybe Text) Source #

Type of your proxy: HTTP, HTTPS, SOCKS4, SOCKS5.

class Coercible Captcha a => HasLocalImage a where Source #

Minimal complete definition

Nothing

Methods

file :: Lens' a (Maybe FilePath) Source #

File path of a captcha image.

body :: Lens' a (Maybe Text) Source #

Base-64 encoded image.

textInstructions :: Lens' a (Maybe Text) Source #

Text which is shown to the worker to help solve a captcha.

imgInstructions :: Lens' a (Maybe FilePath) Source #

Image file path with instructions on solving a captcha.

class Coercible Captcha a => HasLanguage a where Source #

Minimal complete definition

Nothing

Methods

language :: Lens' a (Maybe Int) Source #

The captcha's language:

  1. Not specified.
  2. Cyrillic captcha.
  3. Latin captcha.

languageCode :: Lens' a (Maybe Text) Source #

The captcha's language code. Click here for a list of supported languages.

class Coercible Captcha a => HasUserAgent a where Source #

Minimal complete definition

Nothing

Methods

userAgent :: Lens' a (Maybe Text) Source #

User agent that will be used by the worker when solving the captcha.

Instances

Instances details
HasUserAgent ReCaptchaV2 Source # 
Instance details

Defined in TwoCaptcha.Internal.Types.ReCaptcha

class Coercible Captcha a => HasCookies a where Source #

Minimal complete definition

Nothing

Methods

cookies :: Lens' a (Maybe Text) Source #

Cookies that will be used by the worker solving the captcha. The used cookies will also be included in the response.

Format: KEY1:Value1;KEY2:Value2;