# yesCaptcha **Repository Path**: kaylee595/yesCaptcha ## Basic Information - **Project Name**: yesCaptcha - **Description**: yesCaptcha平台的GO SDK. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-15 - **Last Updated**: 2025-06-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # [YesCaptcha](https://yescaptcha.com/i/UZwLf1)是什么? [YesCaptcha](https://yescaptcha.com/i/UZwLf1)是一个验证码识别/风控绕过服务,它支持以下类型: - 不定长英文数字图片 - reCaptcha V2 - reCaptcha V2 协议接口 - reCaptcha V2 企业版 协议接口 - reCaptcha V2 图像识别接口 - reCaptcha V3 - reCaptcha V3 协议接口 - reCaptcha V3 企业版 协议接口 - HCaptcha - HCaptcha 协议接口 - HCaptcha 图像识别 - Funcaptcha - Funcaptcha 图像识别 - CloudFlare Turnstile 协议接口 - CloudFlare 5秒盾协议接口 # 这个项目解决了什么问题? 该项目提供了Go语言的SDK,用于调用YesCaptcha的API。 目前该项目仅完成了recaptchaV2和recaptchaV3的API,其他类型欢迎提交`pull request`。 如果你不想提交`pull request`, 但是想快速接入其他API, 你也可以使用该库, 但它没有类型提示, 你需要自行构造任务的请求结构和任务响应的Solution结构。 # 如何使用? ## RecaptchaV2识别示例(吾爱论坛登录页面的RecaptchaV2验证码) 注意: 该示例将会消耗15积分. ```go package main import ( "context" "gitee.com/kaylee595/yesCaptcha" "gitee.com/kaylee595/yesCaptcha/taskType/recaptchaV2" "log/slog" "time" ) func main() { const clientKey = "" // 请填写你的clientKey client := yesCaptcha.NewClient(clientKey, yesCaptcha.WithSoftId(61751)) start := time.Now() respCreateTask, err := client.CreateTask(context.Background(), recaptchaV2.Task{ Type: recaptchaV2.TypeNoCaptchaTaskProxyless, WebsiteURL: "https://www.52pojie.cn/member.php?mod=logging&action=login", WebsiteKey: "6LftSMEUAAAAANe9O4IJt4lDNV2naDxJwOu88w5o", }) if err != nil { panic(err) } ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) defer cancel() taskResult, err := yesCaptcha.AwaitGetTaskResult(ctx, func() (*yesCaptcha.RespGetTaskResult[recaptchaV2.Solution], error) { r, err := client.GetTaskResult(context.Background(), respCreateTask.TaskId) if err != nil { return nil, err } return yesCaptcha.TaskResultTo[recaptchaV2.Solution](r) }) if err != nil { panic(err) } slog.Info("识别成功", "gRecaptchaResponse", taskResult.Solution.GRecaptchaResponse, "耗时", time.Since(start)) } ```