funcaptcha

package module
v0.0.0-...-9a21dbb Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 27 Imported by: 1

README

Arkose Fetch

加入SignUp的Arkose获取,arkType为11

Usage for OpenAI

import (
	"fmt"

	"github.com/xqdoo00o/funcaptcha"
)

func main() {
	token, _ := funcaptcha.GetOpenAIToken("", "")
	fmt.Println(token)
}

API:

You can download the binary from releases or go run cmd/api/main.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Yz = map[int]struct {
	Value map[string]ValueFunc
	Key   map[string]KeyFunc
}{
	4: {
		Value: map[string]ValueFunc{
			"alpha": func(c Input) Input {
				yValueStr := strconv.Itoa(c.Index)
				combinedStr := yValueStr + strconv.Itoa(1)
				combinedInt, _ := strconv.Atoi(combinedStr)
				return Input{Index: combinedInt - 2}
			},
			"beta":    func(c Input) Input { return Input{Index: -c.Index} },
			"gamma":   func(c Input) Input { return Input{Index: 3 * (3 - c.Index)} },
			"delta":   func(c Input) Input { return Input{Index: 7 * c.Index} },
			"epsilon": func(c Input) Input { return Input{Index: 2 * c.Index} },
			"zeta": func(c Input) Input {
				if c.Index != 0 {
					return Input{Index: 100 / c.Index}
				}
				return Input{Index: c.Index}
			},
		},
		Key: map[string]KeyFunc{
			"alpha": func(c Input) interface{} {
				return []int{rand.Intn(100), c.Index, rand.Intn(100)}
			},
			"beta": func(c Input) interface{} {
				return map[string]int{
					"size":          50 - c.Index,
					"id":            c.Index,
					"limit":         10 * c.Index,
					"req_timestamp": int(time.Now().UnixNano() / int64(time.Millisecond)),
				}
			},
			"gamma": func(c Input) interface{} {
				return c.Index
			},
			"delta": func(c Input) interface{} {
				return map[string]int{"index": c.Index}
			},
			"epsilon": func(c Input) interface{} {
				arr := make([]int, rand.Intn(5)+1)
				randIndex := rand.Intn(len(arr))
				for i := range arr {
					if i == randIndex {
						arr[i] = c.Index
					} else {
						arr[i] = rand.Intn(10)
					}
				}
				return append(arr, randIndex)
			},
			"zeta": func(c Input) interface{} {
				return append(make([]int, rand.Intn(5)+1), c.Index)
			},
		},
	},
}

Functions

func AesDecrypt

func AesDecrypt(baseText string, password string, fallbackPass string) (string, error)

func Decrypt

func Decrypt(data string, password string, fallbackPass string) string

func DefaultEvpKDF

func DefaultEvpKDF(password []byte, salt []byte) (key []byte, iv []byte, err error)

func DownloadChallenge

func DownloadChallenge(urls []string, b64 bool) ([]string, error)

func Encrypt

func Encrypt(data string, key string) string

func GetOpenAIAuthToken

func GetOpenAIAuthToken(puid string, dx string, proxy string) (string, error)

func GetOpenAIAuthTokenWithBx

func GetOpenAIAuthTokenWithBx(bx string, puid string, dx string, proxy string) (string, error)

func PKCS5Padding

func PKCS5Padding(src []byte, blockSize int) []byte

func SetTLSClient

func SetTLSClient(cli *tls_client.HttpClient)

func YB

func YB(gameType int, apiBreaker *ApiBreaker) func(Input) interface{}

Types

type ApiBreaker

type ApiBreaker struct {
	Key   string   `json:"key"`
	Value []string `json:"value"`
}

type Challenge

type Challenge struct {
	SessionToken         string      `json:"session_token"`
	ChallengeID          string      `json:"challengeID"`
	ChallengeURL         string      `json:"challengeURL"`
	AudioChallengeURLs   []string    `json:"audio_challenge_urls"`
	AudioGameRateLimited interface{} `json:"audio_game_rate_limited"`
	Sec                  int         `json:"sec"`
	EndURL               interface{} `json:"end_url"`
	GameData             struct {
		GameType          int    `json:"gameType"`
		GameVariant       string `json:"game_variant"`
		InstructionString string `json:"instruction_string"`
		CustomGUI         struct {
			ChallengeIMGs       []string    `json:"_challenge_imgs"`
			ApiBreaker          *ApiBreaker `json:"api_breaker"`
			ApiBreakerV2Enabled int         `json:"api_breaker_v2_enabled"`
		} `json:"customGUI"`
	} `json:"game_data"`
	GameSID             string            `json:"game_sid"`
	SID                 string            `json:"sid"`
	Lang                string            `json:"lang"`
	StringTablePrefixes []interface{}     `json:"string_table_prefixes"`
	StringTable         map[string]string `json:"string_table"`
	EarlyVictoryMessage interface{}       `json:"earlyVictoryMessage"`
	FontSizeAdjustments interface{}       `json:"font_size_adjustments"`
	StyleTheme          string            `json:"style_theme"`
}

type ChatArkoseResponse

type ChatArkoseResponse struct {
	Token                    string `json:"token"`
	ChallengeURL             string `json:"challenge_url"`
	ChallengeURLCDN          string `json:"challenge_url_cdn"`
	ChallengeURLCDNSRI       string `json:"challenge_url_cdn_sri"`
	NoScript                 string `json:"noscript"`
	Mbio                     bool   `json:"mbio"`
	Tbio                     bool   `json:"tbio"`
	Kbio                     bool   `json:"kbio"`
	DisableDefaultStyling    bool   `json:"disable_default_styling"`
	CompatibilityModeEnabled bool   `json:"compatibility_mode_enabled"`
	ForceStandardMode        bool   `json:"force_standard_mode"`
}

func GetOpenAIToken

func GetOpenAIToken(version int, puid string, dx string, proxy string) (*ChatArkoseResponse, error)

func GetOpenAITokenWithBx

func GetOpenAITokenWithBx(version int, bx string, puid string, dx string, proxy string) (*ChatArkoseResponse, error)

func GetOpenAiSignupToken

func GetOpenAiSignupToken(datablobVal, proxy string) (*ChatArkoseResponse, error)

type ConciseChallenge

type ConciseChallenge struct {
	GameType     string   `json:"game_type"`
	URLs         []string `json:"urls"`
	Instructions string   `json:"instructions"`
}

type HARData

type HARData struct {
	Log logData `json:"log"`
}

type Input

type Input struct {
	Index int
}

type KeyFunc

type KeyFunc func(Input) interface{}

type Session

type Session struct {
	Sid              string           `json:"sid"`
	SessionToken     string           `json:"session_token"`
	Hex              string           `json:"hex"`
	ChallengeLogger  challengeLogger  `json:"challenge_logger"`
	Challenge        Challenge        `json:"challenge"`
	ConciseChallenge ConciseChallenge `json:"concise_challenge"`
	Headers          http.Header      `json:"headers"`
}

func StartChallenge

func StartChallenge(full_session, hex string) (*Session, error)

func (*Session) RequestChallenge

func (c *Session) RequestChallenge(isAudioGame bool) (*ApiBreaker, error)

func (*Session) SubmitAnswer

func (c *Session) SubmitAnswer(indices []int, isAudio bool, apiBreaker *ApiBreaker) error

type ValueFunc

type ValueFunc func(Input) Input

Directories

Path Synopsis
cmd
api

Jump to

Keyboard shortcuts

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