vastcap

package module
v0.0.0-...-0abe1be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 4 Imported by: 0

README

VastCap Go

Go Reference Go Report Card

A Go wrapper for the VastCap API.

Installation

go get github.com/justyuuto/vastcap-go

Usage

package main

import "github.com/justyuuto/vastcap-go"

func main() {
    // Initialize the VastCap client with your API key
    client := vastcap.New("your_api_key")

    // Create a new task
    taskId, err := client.HCaptcha(vastcap.HCaptchaTask{
        WebsiteURL: "https://example.com",
        WebsiteKey: "website_key",
        // ...
    })
    if err != nil {
        panic(err)
    }

    // Get its result
    result, err := client.GetResult(taskId)
    if err != nil {
        panic(err)
    }
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FunCaptchaTask

type FunCaptchaTask struct {
	TaskBase
	Data struct {
		// The blob parameter extracted from the FunCaptcha challenge.
		Blob string `json:"blob,omitempty"`
		// Custom cookies required by some websites. Format is a key-value object with cookie names and values.
		CustomCookies map[string]string `json:"custom_cookies,omitempty"`
	} `json:"data,omitempty"`
}

type HCaptchaTask

type HCaptchaTask struct {
	TaskBase
	// The rqdata value from the hCaptcha challenge. Required for some implementations.
	RqData string `json:"rqdata,omitempty"`
	// Set to true if the hCaptcha is invisible. Default is false.
	Invisible bool `json:"invisible,omitempty"`
	// Set to true for enterprise hCaptcha (Discord, Epic Games, TikTok, etc). Default is false.
	Enterprise bool `json:"enterprise,omitempty"`
}

type RecaptchaTask

type RecaptchaTask struct {
	TaskBase
	// Set to true if the reCAPTCHA is invisible. Only applicable for RecaptchaV2Task.
	IsInvisible bool `json:"isInvisible,omitempty"`
	// Minimum score required for reCAPTCHA v3. Only applicable for RecaptchaV3Task.
	MinScore float64 `json:"minScore,omitempty"`
	// Action name used for reCAPTCHA v3. Only applicable for RecaptchaV3Task.
	PageAction string `json:"pageAction,omitempty"`
}

type TaskBase

type TaskBase struct {
	Type string `json:"type"`
	// Proxy in format login:password@ip_address:port.
	Proxy string `json:"proxy,omitempty"`
	// The User-Agent header that will be used in solving the captcha.
	UserAgent string `json:"userAgent,omitempty"`
	// The site key of the captcha from the target website.
	WebsiteKey string `json:"websiteKey"`
	// The URL of the page where the captcha is located.
	WebsiteURL string `json:"websiteURL"`
}

type TaskResult

type TaskResult struct {
	// The status of the task. Can be one of:
	//   processing - The task is still being processed
	//   ready - The task has been completed
	//   failed - The task has failed
	Status string `json:"status"`
	// The solution data. Only present when status is "ready".
	Solution *taskSolution `json:"solution,omitempty"`
	// Error details. Only present when status is "failed".
	Error *apiError `json:"error,omitempty"`
}

type TurnstileTask

type TurnstileTask struct {
	TaskBase
	// Set to true if the Turnstile is invisible. Default is false.
	Invisible bool `json:"invisible,omitempty"`
}

type VastCap

type VastCap struct {
	APIKey string
}

func New

func New(apiKey string) *VastCap

func (*VastCap) FunCaptcha

func (c *VastCap) FunCaptcha(data FunCaptchaTask) (string, error)

func (*VastCap) GetResult

func (c *VastCap) GetResult(taskID string) (TaskResult, error)

GetResult retrieves the result of a previously created task by its ID.

func (*VastCap) HCaptcha

func (c *VastCap) HCaptcha(data HCaptchaTask) (string, error)

func (*VastCap) ImageToText

func (c *VastCap) ImageToText(data TaskBase) (string, error)

func (*VastCap) Recaptcha

func (c *VastCap) Recaptcha(data RecaptchaTask, v3 bool) (string, error)

func (*VastCap) Turnstile

func (c *VastCap) Turnstile(data TurnstileTask) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL