-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A package for integrating a variety of captcha solving services. -- -- A package for integrating a variety of captcha solving services. -- -- Feature list: -- -- @package captcha-core @version 0.1.0.0 -- | This module is for internal-use and does not follow pvp versioning -- policies. module Captcha.Internal.Monad -- | Effect providing an environment required to solve captchas. newtype Captcha a Captcha :: (CaptchaEnv -> IO a) -> Captcha a [runCaptcha] :: Captcha a -> CaptchaEnv -> IO a -- | Provides an HTTP Session to be reused for each request. newtype CaptchaEnv CaptchaEnv :: Session -> CaptchaEnv [_session] :: CaptchaEnv -> Session class HasCaptchaEnv c_acXl captchaEnv :: HasCaptchaEnv c_acXl => Lens' c_acXl CaptchaEnv session :: HasCaptchaEnv c_acXl => Lens' c_acXl Session -- | Create the environment required to solve captchas. mkCaptchaEnv :: MonadIO m => m CaptchaEnv instance Captcha.Internal.Monad.HasCaptchaEnv Captcha.Internal.Monad.CaptchaEnv instance Control.Monad.IO.Unlift.MonadUnliftIO Captcha.Internal.Monad.Captcha instance Control.Monad.Reader.Class.MonadReader Captcha.Internal.Monad.CaptchaEnv Captcha.Internal.Monad.Captcha instance Control.Monad.IO.Class.MonadIO Captcha.Internal.Monad.Captcha instance GHC.Base.Monad Captcha.Internal.Monad.Captcha instance GHC.Base.Applicative Captcha.Internal.Monad.Captcha instance GHC.Base.Functor Captcha.Internal.Monad.Captcha -- | This module is for internal-use and does not follow pvp versioning -- policies. module Captcha.Internal.Request -- | Send a POST request with the given session from CaptchaEnv. post :: (HasCaptchaEnv r, MonadReader r m, MonadIO m, Postable a) => Options -> Text -> a -> m (Response ByteString) -- | Send a GET request with the given session from CaptchaEnv. get :: (HasCaptchaEnv r, MonadReader r m, MonadIO m) => Options -> Text -> m (Response ByteString) -- | This module is for internal-use and does not follow pvp versioning -- policies. module Captcha.Internal.Types -- | Proxy protocol. data ProxyProtocol Http :: ProxyProtocol Https :: ProxyProtocol Socks4 :: ProxyProtocol Socks5 :: ProxyProtocol -- | Proxy authentication. data ProxyAuth ProxyAuth :: Text -> Text -> ProxyAuth [$sel:_username:ProxyAuth] :: ProxyAuth -> Text [$sel:_password:ProxyAuth] :: ProxyAuth -> Text class HasPassword s a | s -> a password :: HasPassword s a => Lens' s a class HasUsername s a | s -> a username :: HasUsername s a => Lens' s a -- | Proxy to be used when solving a captcha. data Proxy Proxy :: Text -> ProxyProtocol -> Int -> Maybe ProxyAuth -> Proxy -- | Proxy address. [$sel:_address:Proxy] :: Proxy -> Text -- | Protocol of the proxy. [$sel:_protocol:Proxy] :: Proxy -> ProxyProtocol -- | Proxy port. [$sel:_port:Proxy] :: Proxy -> Int -- | Proxy authentication, if required. [$sel:_auth:Proxy] :: Proxy -> Maybe ProxyAuth class HasAddress s a | s -> a address :: HasAddress s a => Lens' s a class HasAuth s a | s -> a auth :: HasAuth s a => Lens' s a class HasPort s a | s -> a port :: HasPort s a => Lens' s a class HasProtocol s a | s -> a protocol :: HasProtocol s a => Lens' s a -- | Parameters for solving a captcha with text within an image. data ImageCaptcha ImageCaptcha :: Text -> Maybe (Time Millisecond) -> Maybe (Time Millisecond) -> Text -> ImageCaptcha -- | The captcha solver's API key. [$sel:_apiKey:ImageCaptcha] :: ImageCaptcha -> Text -- | The interval to poll for the captcha's answer. [$sel:_pollingInterval:ImageCaptcha] :: ImageCaptcha -> Maybe (Time Millisecond) -- | The duration to keep polling for the answer. [$sel:_timeoutDuration:ImageCaptcha] :: ImageCaptcha -> Maybe (Time Millisecond) -- | The image, encoded in base-64. [$sel:_body:ImageCaptcha] :: ImageCaptcha -> Text class HasApiKey s a | s -> a apiKey :: HasApiKey s a => Lens' s a class HasBody s a | s -> a body :: HasBody s a => Lens' s a class HasPollingInterval s a | s -> a pollingInterval :: HasPollingInterval s a => Lens' s a class HasTimeoutDuration s a | s -> a timeoutDuration :: HasTimeoutDuration s a => Lens' s a -- | Parameters for solving a text captcha. data TextCaptcha TextCaptcha :: Text -> Maybe (Time Millisecond) -> Maybe (Time Millisecond) -> Text -> TextCaptcha -- | The captcha solver's API key. [$sel:_apiKey:TextCaptcha] :: TextCaptcha -> Text -- | The interval to poll for the captcha's answer. [$sel:_pollingInterval:TextCaptcha] :: TextCaptcha -> Maybe (Time Millisecond) -- | The duration to keep polling for the answer. [$sel:_timeoutDuration:TextCaptcha] :: TextCaptcha -> Maybe (Time Millisecond) -- | The text captcha to solve. [$sel:_body:TextCaptcha] :: TextCaptcha -> Text -- | Parameters for solving Arkose Lab's FunCaptcha. data FunCaptcha FunCaptcha :: Text -> Maybe (Time Millisecond) -> Maybe (Time Millisecond) -> Text -> Text -> Maybe Text -> Maybe Text -> Maybe Proxy -> Cookies -> FunCaptcha -- | The captcha solver's API key. [$sel:_apiKey:FunCaptcha] :: FunCaptcha -> Text -- | The interval to poll for the captcha's answer. [$sel:_pollingInterval:FunCaptcha] :: FunCaptcha -> Maybe (Time Millisecond) -- | The duration to keep polling for the answer. [$sel:_timeoutDuration:FunCaptcha] :: FunCaptcha -> Maybe (Time Millisecond) -- | Url where the captcha is found. [$sel:_captchaUrl:FunCaptcha] :: FunCaptcha -> Text -- | FunCaptcha's data-pkey value. [$sel:_captchaKey:FunCaptcha] :: FunCaptcha -> Text -- | FunCaptcha's surl service url value. [$sel:_serviceUrl:FunCaptcha] :: FunCaptcha -> Maybe Text -- | User agent to be used when solving the captcha. [$sel:_userAgent:FunCaptcha] :: FunCaptcha -> Maybe Text -- | Proxy to be used when solving the captcha. [$sel:_proxy:FunCaptcha] :: FunCaptcha -> Maybe Proxy -- | Cookies to be used when solving the captcha. [$sel:_cookies:FunCaptcha] :: FunCaptcha -> Cookies class HasCaptchaKey s a | s -> a captchaKey :: HasCaptchaKey s a => Lens' s a class HasCaptchaUrl s a | s -> a captchaUrl :: HasCaptchaUrl s a => Lens' s a class HasCookies s a | s -> a cookies :: HasCookies s a => Lens' s a class HasProxy s a | s -> a proxy :: HasProxy s a => Lens' s a class HasServiceUrl s a | s -> a serviceUrl :: HasServiceUrl s a => Lens' s a class HasUserAgent s a | s -> a userAgent :: HasUserAgent s a => Lens' s a -- | Parameters for solving Google's reCAPTCHA v2. data ReCaptchaV2 ReCaptchaV2 :: Text -> Maybe (Time Millisecond) -> Maybe (Time Millisecond) -> Text -> Text -> Maybe Text -> Bool -> Maybe Text -> Maybe Proxy -> Cookies -> ReCaptchaV2 -- | The captcha solver's API key. [$sel:_apiKey:ReCaptchaV2] :: ReCaptchaV2 -> Text -- | The interval to poll for the captcha's answer. [$sel:_pollingInterval:ReCaptchaV2] :: ReCaptchaV2 -> Maybe (Time Millisecond) -- | The duration to keep polling for the answer. [$sel:_timeoutDuration:ReCaptchaV2] :: ReCaptchaV2 -> Maybe (Time Millisecond) -- | Url where the captcha is found. [$sel:_captchaUrl:ReCaptchaV2] :: ReCaptchaV2 -> Text -- | reCAPTCHA v2's data-sitekey value. [$sel:_captchaKey:ReCaptchaV2] :: ReCaptchaV2 -> Text -- | reCAPTCHA's v2's data-s value. [$sel:_dataS:ReCaptchaV2] :: ReCaptchaV2 -> Maybe Text -- | Is the reCAPTCHA an invisible or normal captcha? [$sel:_invisible:ReCaptchaV2] :: ReCaptchaV2 -> Bool -- | User agent to be used when solving the captcha. [$sel:_userAgent:ReCaptchaV2] :: ReCaptchaV2 -> Maybe Text -- | Proxy to be used when solving the captcha. [$sel:_proxy:ReCaptchaV2] :: ReCaptchaV2 -> Maybe Proxy -- | Cookies to be used when solving the captcha. [$sel:_cookies:ReCaptchaV2] :: ReCaptchaV2 -> Cookies class HasDataS s a | s -> a dataS :: HasDataS s a => Lens' s a class HasInvisible s a | s -> a invisible :: HasInvisible s a => Lens' s a -- | Parameters for solving Google's reCAPTCHA v3. data ReCaptchaV3 ReCaptchaV3 :: Text -> Maybe (Time Millisecond) -> Maybe (Time Millisecond) -> Text -> Text -> Double -> Maybe Text -> Maybe Text -> Maybe Proxy -> Cookies -> ReCaptchaV3 -- | The captcha solver's API key. [$sel:_apiKey:ReCaptchaV3] :: ReCaptchaV3 -> Text -- | The interval to poll for the captcha's answer. [$sel:_pollingInterval:ReCaptchaV3] :: ReCaptchaV3 -> Maybe (Time Millisecond) -- | The duration to keep polling for the answer. [$sel:_timeoutDuration:ReCaptchaV3] :: ReCaptchaV3 -> Maybe (Time Millisecond) -- | Url where the captcha is found. [$sel:_captchaUrl:ReCaptchaV3] :: ReCaptchaV3 -> Text -- | reCAPTCHA v3's sitekey value. [$sel:_captchaKey:ReCaptchaV3] :: ReCaptchaV3 -> Text -- | reCAPTCHA v3's minimum score. [$sel:_minScore:ReCaptchaV3] :: ReCaptchaV3 -> Double -- | reCAPTCHA v3's action value. [$sel:_action:ReCaptchaV3] :: ReCaptchaV3 -> Maybe Text -- | User agent to be used when solving the captcha. [$sel:_userAgent:ReCaptchaV3] :: ReCaptchaV3 -> Maybe Text -- | Proxy to be used when solving the captcha. [$sel:_proxy:ReCaptchaV3] :: ReCaptchaV3 -> Maybe Proxy -- | Cookies to be used when solving the captcha. [$sel:_cookies:ReCaptchaV3] :: ReCaptchaV3 -> Cookies class HasAction s a | s -> a action :: HasAction s a => Lens' s a class HasMinScore s a | s -> a minScore :: HasMinScore s a => Lens' s a -- | Parameters for solving hCaptcha. data HCaptcha HCaptcha :: Text -> Maybe (Time Millisecond) -> Maybe (Time Millisecond) -> Text -> Text -> Bool -> Maybe Text -> Maybe Text -> Maybe Proxy -> Cookies -> HCaptcha -- | The captcha solver's API key. [$sel:_apiKey:HCaptcha] :: HCaptcha -> Text -- | The interval to poll for the captcha's answer. [$sel:_pollingInterval:HCaptcha] :: HCaptcha -> Maybe (Time Millisecond) -- | The duration to keep polling for the answer. [$sel:_timeoutDuration:HCaptcha] :: HCaptcha -> Maybe (Time Millisecond) -- | Url where the captcha is found. [$sel:_captchaUrl:HCaptcha] :: HCaptcha -> Text -- | hCaptcha's data-sitekey value. [$sel:_captchaKey:HCaptcha] :: HCaptcha -> Text -- | Is the hCaptcha an invisible or normal captcha? [$sel:_invisible:HCaptcha] :: HCaptcha -> Bool -- | Custom data used in some implementations of hCaptcha. Note: You must -- provide a matching user agent if this is used. [$sel:_rqData:HCaptcha] :: HCaptcha -> Maybe Text -- | User agent to be used when solving the captcha. Required when using -- rqData. [$sel:_userAgent:HCaptcha] :: HCaptcha -> Maybe Text -- | Proxy to be used when solving the captcha. [$sel:_proxy:HCaptcha] :: HCaptcha -> Maybe Proxy -- | Cookies to be used when solving the captcha. [$sel:_cookies:HCaptcha] :: HCaptcha -> Cookies class HasRqData s a | s -> a rqData :: HasRqData s a => Lens' s a instance Captcha.Internal.Types.HasRqData Captcha.Internal.Types.HCaptcha (GHC.Maybe.Maybe Data.Text.Internal.Text) instance Captcha.Internal.Types.HasApiKey Captcha.Internal.Types.HCaptcha Data.Text.Internal.Text instance Captcha.Internal.Types.HasCaptchaKey Captcha.Internal.Types.HCaptcha Data.Text.Internal.Text instance Captcha.Internal.Types.HasCaptchaUrl Captcha.Internal.Types.HCaptcha Data.Text.Internal.Text instance Captcha.Internal.Types.HasCookies Captcha.Internal.Types.HCaptcha Web.Cookie.Cookies instance Captcha.Internal.Types.HasInvisible Captcha.Internal.Types.HCaptcha GHC.Types.Bool instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasPollingInterval Captcha.Internal.Types.HCaptcha a instance Captcha.Internal.Types.HasProxy Captcha.Internal.Types.HCaptcha (GHC.Maybe.Maybe Captcha.Internal.Types.Proxy) instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasTimeoutDuration Captcha.Internal.Types.HCaptcha a instance Captcha.Internal.Types.HasUserAgent Captcha.Internal.Types.HCaptcha (GHC.Maybe.Maybe Data.Text.Internal.Text) instance Data.Default.Class.Default Captcha.Internal.Types.HCaptcha instance GHC.Generics.Generic Captcha.Internal.Types.HCaptcha instance GHC.Show.Show Captcha.Internal.Types.HCaptcha instance Captcha.Internal.Types.HasMinScore Captcha.Internal.Types.ReCaptchaV3 GHC.Types.Double instance Captcha.Internal.Types.HasAction Captcha.Internal.Types.ReCaptchaV3 (GHC.Maybe.Maybe Data.Text.Internal.Text) instance Captcha.Internal.Types.HasApiKey Captcha.Internal.Types.ReCaptchaV3 Data.Text.Internal.Text instance Captcha.Internal.Types.HasCaptchaKey Captcha.Internal.Types.ReCaptchaV3 Data.Text.Internal.Text instance Captcha.Internal.Types.HasCaptchaUrl Captcha.Internal.Types.ReCaptchaV3 Data.Text.Internal.Text instance Captcha.Internal.Types.HasCookies Captcha.Internal.Types.ReCaptchaV3 Web.Cookie.Cookies instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasPollingInterval Captcha.Internal.Types.ReCaptchaV3 a instance Captcha.Internal.Types.HasProxy Captcha.Internal.Types.ReCaptchaV3 (GHC.Maybe.Maybe Captcha.Internal.Types.Proxy) instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasTimeoutDuration Captcha.Internal.Types.ReCaptchaV3 a instance Captcha.Internal.Types.HasUserAgent Captcha.Internal.Types.ReCaptchaV3 (GHC.Maybe.Maybe Data.Text.Internal.Text) instance GHC.Show.Show Captcha.Internal.Types.ReCaptchaV3 instance Data.Default.Class.Default Captcha.Internal.Types.ReCaptchaV3 instance GHC.Generics.Generic Captcha.Internal.Types.ReCaptchaV3 instance Captcha.Internal.Types.HasInvisible Captcha.Internal.Types.ReCaptchaV2 GHC.Types.Bool instance Captcha.Internal.Types.HasDataS Captcha.Internal.Types.ReCaptchaV2 (GHC.Maybe.Maybe Data.Text.Internal.Text) instance Captcha.Internal.Types.HasApiKey Captcha.Internal.Types.ReCaptchaV2 Data.Text.Internal.Text instance Captcha.Internal.Types.HasCaptchaKey Captcha.Internal.Types.ReCaptchaV2 Data.Text.Internal.Text instance Captcha.Internal.Types.HasCaptchaUrl Captcha.Internal.Types.ReCaptchaV2 Data.Text.Internal.Text instance Captcha.Internal.Types.HasCookies Captcha.Internal.Types.ReCaptchaV2 Web.Cookie.Cookies instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasPollingInterval Captcha.Internal.Types.ReCaptchaV2 a instance Captcha.Internal.Types.HasProxy Captcha.Internal.Types.ReCaptchaV2 (GHC.Maybe.Maybe Captcha.Internal.Types.Proxy) instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasTimeoutDuration Captcha.Internal.Types.ReCaptchaV2 a instance Captcha.Internal.Types.HasUserAgent Captcha.Internal.Types.ReCaptchaV2 (GHC.Maybe.Maybe Data.Text.Internal.Text) instance GHC.Show.Show Captcha.Internal.Types.ReCaptchaV2 instance Data.Default.Class.Default Captcha.Internal.Types.ReCaptchaV2 instance GHC.Generics.Generic Captcha.Internal.Types.ReCaptchaV2 instance Captcha.Internal.Types.HasUserAgent Captcha.Internal.Types.FunCaptcha (GHC.Maybe.Maybe Data.Text.Internal.Text) instance Captcha.Internal.Types.HasServiceUrl Captcha.Internal.Types.FunCaptcha (GHC.Maybe.Maybe Data.Text.Internal.Text) instance Captcha.Internal.Types.HasProxy Captcha.Internal.Types.FunCaptcha (GHC.Maybe.Maybe Captcha.Internal.Types.Proxy) instance Captcha.Internal.Types.HasCookies Captcha.Internal.Types.FunCaptcha Web.Cookie.Cookies instance Captcha.Internal.Types.HasCaptchaUrl Captcha.Internal.Types.FunCaptcha Data.Text.Internal.Text instance Captcha.Internal.Types.HasCaptchaKey Captcha.Internal.Types.FunCaptcha Data.Text.Internal.Text instance Captcha.Internal.Types.HasApiKey Captcha.Internal.Types.FunCaptcha Data.Text.Internal.Text instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasPollingInterval Captcha.Internal.Types.FunCaptcha a instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasTimeoutDuration Captcha.Internal.Types.FunCaptcha a instance GHC.Show.Show Captcha.Internal.Types.FunCaptcha instance Data.Default.Class.Default Captcha.Internal.Types.FunCaptcha instance GHC.Generics.Generic Captcha.Internal.Types.FunCaptcha instance Captcha.Internal.Types.HasApiKey Captcha.Internal.Types.TextCaptcha Data.Text.Internal.Text instance Captcha.Internal.Types.HasBody Captcha.Internal.Types.TextCaptcha Data.Text.Internal.Text instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasPollingInterval Captcha.Internal.Types.TextCaptcha a instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasTimeoutDuration Captcha.Internal.Types.TextCaptcha a instance GHC.Show.Show Captcha.Internal.Types.TextCaptcha instance Data.Default.Class.Default Captcha.Internal.Types.TextCaptcha instance GHC.Generics.Generic Captcha.Internal.Types.TextCaptcha instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasTimeoutDuration Captcha.Internal.Types.ImageCaptcha a instance (a GHC.Types.~ GHC.Maybe.Maybe (Time.Units.Time Time.Units.Millisecond)) => Captcha.Internal.Types.HasPollingInterval Captcha.Internal.Types.ImageCaptcha a instance Captcha.Internal.Types.HasBody Captcha.Internal.Types.ImageCaptcha Data.Text.Internal.Text instance Captcha.Internal.Types.HasApiKey Captcha.Internal.Types.ImageCaptcha Data.Text.Internal.Text instance GHC.Show.Show Captcha.Internal.Types.ImageCaptcha instance Data.Default.Class.Default Captcha.Internal.Types.ImageCaptcha instance GHC.Generics.Generic Captcha.Internal.Types.ImageCaptcha instance Captcha.Internal.Types.HasProtocol Captcha.Internal.Types.Proxy Captcha.Internal.Types.ProxyProtocol instance Captcha.Internal.Types.HasPort Captcha.Internal.Types.Proxy GHC.Types.Int instance Captcha.Internal.Types.HasAuth Captcha.Internal.Types.Proxy (GHC.Maybe.Maybe Captcha.Internal.Types.ProxyAuth) instance Captcha.Internal.Types.HasAddress Captcha.Internal.Types.Proxy Data.Text.Internal.Text instance GHC.Show.Show Captcha.Internal.Types.Proxy instance Data.Default.Class.Default Captcha.Internal.Types.Proxy instance GHC.Generics.Generic Captcha.Internal.Types.Proxy instance Captcha.Internal.Types.HasUsername Captcha.Internal.Types.ProxyAuth Data.Text.Internal.Text instance Captcha.Internal.Types.HasPassword Captcha.Internal.Types.ProxyAuth Data.Text.Internal.Text instance GHC.Show.Show Captcha.Internal.Types.ProxyProtocol instance GHC.Show.Show Captcha.Internal.Types.ProxyAuth instance Data.Default.Class.Default Captcha.Internal.Types.ProxyAuth instance GHC.Generics.Generic Captcha.Internal.Types.ProxyAuth instance Data.Default.Class.Default Captcha.Internal.Types.ProxyProtocol instance Data.Default.Class.Default GHC.Types.Bool -- | This module is for internal-use and does not follow pvp versioning -- policies. module Captcha.Internal.Monad.Class -- | Abstracts over a captcha solving service. class Monad m => MonadCaptcha api r m where { -- | An error specific to the captcha solving service. type family CaptchaError api r m; } -- | Submit a task to be solved by the api service. createTask :: (MonadCaptcha api r m, CaptchaRequest api ctx r m) => ctx -> m (Either (CaptchaError api r m) (CaptchaId ctx)) -- | Attempt to retrieve the answer of the captcha. getTask :: (MonadCaptcha api r m, CaptchaResponse api ctx) => Text -> CaptchaId ctx -> m (Either (CaptchaError api r m) Text) -- | Solves a captcha by submitting it with createTask and then -- polling with getTask until the answer is ready. -- -- This will poll until the configured timeout duration is past. Its -- default value depends on the captcha service. solve :: (MonadCaptcha api r m, CaptchaRequest api ctx r m, CaptchaResponse api ctx, HasApiKey ctx Text, HasPollingInterval ctx (Maybe (Time Millisecond)), HasTimeoutDuration ctx (Maybe (Time Millisecond))) => ctx -> m (Either (CaptchaError api r m) Text) -- | Different captcha services have different request formats. This -- abstracts over it and sends the correct HTTP request. class CaptchaRequest api ctx r m -- | Send a request using the given captcha context. request :: CaptchaRequest api ctx r m => ctx -> Text -> m (Response ByteString) -- | Different captcha services have different response formats. This -- abstracts over it and provides the captcha result. class CaptchaResponse api ctx -- | Parse the captcha result from the given json. parseResult :: CaptchaResponse api ctx => Value -> Maybe Value -- | Identifier for retrieving a captcha's answer. newtype CaptchaId ctx CaptchaId :: Integer -> CaptchaId ctx [unCaptchaId] :: CaptchaId ctx -> Integer instance GHC.Classes.Ord (Captcha.Internal.Monad.Class.CaptchaId ctx) instance GHC.Classes.Eq (Captcha.Internal.Monad.Class.CaptchaId ctx) instance GHC.Show.Show (Captcha.Internal.Monad.Class.CaptchaId ctx) -- | This module is for internal-use and does not follow pvp versioning -- policies. module Captcha.Internal -- | Render the cookies as a lazy text. renderCookies :: HasCookies a Cookies => a -> Text -- | Retrieve the proxy's type as, converted into Text. getProxyType :: HasProxy a (Maybe Proxy) => a -> Maybe Text -- | Retrieve the proxy's host address. getProxyAddress :: HasProxy a (Maybe Proxy) => a -> Maybe Text -- | Retrieve the proxy's port. getProxyPort :: HasProxy a (Maybe Proxy) => a -> Maybe Int -- | Retrieve the proxy's authentication username. getProxyUsername :: HasProxy a (Maybe Proxy) => a -> Maybe Text -- | Retrieve the proxy's authentication password. getProxyPassword :: HasProxy a (Maybe Proxy) => a -> Maybe Text -- | This module exports functions that follow the pvp versioning policies. module Captcha -- | Proxy authentication. data ProxyAuth ProxyAuth :: Text -> Text -> ProxyAuth [$sel:_username:ProxyAuth] :: ProxyAuth -> Text [$sel:_password:ProxyAuth] :: ProxyAuth -> Text -- | Proxy protocol. data ProxyProtocol Http :: ProxyProtocol Https :: ProxyProtocol Socks4 :: ProxyProtocol Socks5 :: ProxyProtocol -- | Proxy to be used when solving a captcha. data Proxy Proxy :: Text -> ProxyProtocol -> Int -> Maybe ProxyAuth -> Proxy -- | Proxy address. [$sel:_address:Proxy] :: Proxy -> Text -- | Protocol of the proxy. [$sel:_protocol:Proxy] :: Proxy -> ProxyProtocol -- | Proxy port. [$sel:_port:Proxy] :: Proxy -> Int -- | Proxy authentication, if required. [$sel:_auth:Proxy] :: Proxy -> Maybe ProxyAuth class HasUsername s a | s -> a username :: HasUsername s a => Lens' s a class HasPassword s a | s -> a password :: HasPassword s a => Lens' s a -- | Parameters for solving a captcha with text within an image. data ImageCaptcha class HasProtocol s a | s -> a protocol :: HasProtocol s a => Lens' s a class HasPort s a | s -> a port :: HasPort s a => Lens' s a class HasAuth s a | s -> a auth :: HasAuth s a => Lens' s a class HasAddress s a | s -> a address :: HasAddress s a => Lens' s a -- | Parameters for solving a text captcha. data TextCaptcha class HasTimeoutDuration s a | s -> a timeoutDuration :: HasTimeoutDuration s a => Lens' s a class HasPollingInterval s a | s -> a pollingInterval :: HasPollingInterval s a => Lens' s a class HasBody s a | s -> a body :: HasBody s a => Lens' s a class HasApiKey s a | s -> a apiKey :: HasApiKey s a => Lens' s a -- | Parameters for solving Arkose Lab's FunCaptcha. data FunCaptcha -- | Parameters for solving Google's reCAPTCHA v2. data ReCaptchaV2 class HasUserAgent s a | s -> a userAgent :: HasUserAgent s a => Lens' s a class HasServiceUrl s a | s -> a serviceUrl :: HasServiceUrl s a => Lens' s a class HasProxy s a | s -> a proxy :: HasProxy s a => Lens' s a class HasCookies s a | s -> a cookies :: HasCookies s a => Lens' s a class HasCaptchaUrl s a | s -> a captchaUrl :: HasCaptchaUrl s a => Lens' s a class HasCaptchaKey s a | s -> a captchaKey :: HasCaptchaKey s a => Lens' s a -- | Parameters for solving Google's reCAPTCHA v3. data ReCaptchaV3 class HasInvisible s a | s -> a invisible :: HasInvisible s a => Lens' s a class HasDataS s a | s -> a dataS :: HasDataS s a => Lens' s a -- | Parameters for solving hCaptcha. data HCaptcha class HasMinScore s a | s -> a minScore :: HasMinScore s a => Lens' s a class HasAction s a | s -> a action :: HasAction s a => Lens' s a class HasRqData s a | s -> a rqData :: HasRqData s a => Lens' s a