Yidun - NECaptcha
任务示例
- Jigsaw
- Jigsaw (slide_trajectory)
- Picture-click
- Avoid
- Icon-click
- Inference
- Sense
- Space-inference




![]()


CapMonster Cloud 默认通过内置代理工作——这些代理已包含在费用内。仅当网站不接受令牌或对内置服务的访问受限时,才需要指定您自己的代理。
如果代理按 IP 授权,请将地址 65.21.190.34 加入白名单。
请求参数
重要:某些参数的值是动态的——它们会在包含 Yidun 的页面每次渲染时发生变化。
请在创建任务之前立即提取这些参数,以避免在求解过程中出现错误。
有关参数提取的示例,请参阅如何获取所有必要的参数。
type<string>requiredYidunTask
websiteURL<string>required包含验证码页面的完整 URL。
websiteKey<string>required在页面上找到的 siteKey 参数值(参见下方查找示例)。
userAgent<string>optional浏览器的 User-Agent。
请仅传递最新的 Windows 系统 UA,目前推荐使用:userAgentPlaceholder
yidunGetLib<string>optional用于在页面上加载验证码的 JavaScript 文件路径。
重要:请指定完整链接(https://...)。
如果网站上存在 challenge、hcg、hct 字段,建议使用此参数。
yidunApiServerSubdomain<string>optionalYidun API 服务器的子域名。
重要:必须不同于标准域名 c.dun.163.com 和 c-v6.dun.163.com。
仅指定域名,不包含 https:// 前缀。
如果使用自定义服务器,则此参数为必填项(Enterprise 版本中经常出现)。
challenge<string>optional当前验证码的唯一标识符。
通常在初始化或显示验证码时通过网络请求传递。
Enterprise 验证码的特征。
hcg<string>optional验证码哈希值,用于构建请求。
可与 challenge 一起获取。
hct<integer>optionalEnterprise 版本验证时使用的数字时间标识符/时间戳。
proxyType<string>optionalhttp - 普通 http/https 代理;
https - 如果 http 不工作,可以尝试此选项(部分自定义代理要求);
socks4 - socks4 代理;
socks5 - socks5 代理。
proxyAddress<string>optional代理的 IPv4 或 IPv6 地址。禁止以下情况:
- 使用透明代理(即暴露真实客户端 IP);
- 使用本地代理地址。
proxyPort<integer>optional代理端口。
proxyLogin<string>optional代理用户名。
proxyPassword<string>optional代理密码。
创建任务的方法
- YidunTask(无代理)
- YidunTask(使用代理)
https://api.capmonster.cloud/createTask
请求示例
{
"clientKey": "API_KEY",
"task": {
"type": "YidunTask",
"websiteURL": "https://yourwebsite.com/page-with-yidun",
"websiteKey": "your-website-key",
"userAgent": "userAgentPlaceholder"
}
}
响应示例
{
"errorId": 0,
"taskId": 407533077
}
https://api.capmonster.cloud/createTask
请求示例
{
"clientKey": "API_KEY",
"task": {
"type": "YidunTask",
"websiteURL": "https://yourwebsite.com/page-with-yidun",
"websiteKey": "your-website-key",
"userAgent": "userAgentPlaceholder",
"proxyType": "your-proxy-type",
"proxyAddress": "your-proxy-address",
"proxyPort": 1234,
"proxyLogin": "your-proxy-login",
"proxyPassword": "your-proxy-password"
}
}
响应示例
{
"errorId": 0,
"taskId": 407533077
}
获取结果的方法
使用方法 getTaskResult 获取 Yidun 验证码的解决结果。
https://api.capmonster.cloud/getTaskResult
请求示例
{
"clientKey": "API_KEY",
"taskId": 407533077
}
响应示例
{
"errorId": 0,
"errorCode": null,
"errorDescription": null,
"solution": {
"token": "CN31_9AwsPmaYcJameP_09rA0vkVMQsPij...RXTlFJFc3"
},
"status": "ready"
}
何时需要传递 yidunGetLib 和 yidunApiServerSubdomain?
如果您在开发者工具的 Network 标签中发现 challenge、hcg 或 hct 字段,则说明该网站使用的是 Enterprise(或 Business)版本的 Yidun,此时需额外传递 yidunGetLib 和 yidunApiServerSubdomain 参数,以便正确解决。
任务示例
重要:所列参数值仅作为示例。使用前,请将其替换为您项目的当前有效数据。
{
"type": "YidunTask",
"websiteURL": "https://id7.cloud.example.com/IframeLogin.html",
"websiteKey": "0f123r2a6am56431yg17n8rz6grz0ym6",
"userAgent": "userAgentPlaceholder",
"yidunGetLib": "https://example.com/captcha/b/v3//static/load.min.js",
"yidunApiServerSubdomain": "csc-captcha-example.com",
"challenge": "abc55382321547556267884cc3ba57c3d8a7c14f541fd9c6a7f1ce3173d3b9a1",
"hcg": "9a217825f3dcfac3d34e551e93819d610dec931e5e2a2236edf0e1f3f320c191",
"hct": 1751469954806
}
如何获取所有必要的参数
websiteURL 和 websiteKey
打开开发者工具,触发验证码,转到 Network 选项卡,并在请求中找到以 get?referer= 或 check?referer= 开头的请求。referer 的值即为 websiteURL。

有时 URL 中的 referer 会经过编码,例如:https%3A%2F%2Fid.example.com%2F。要获得可读地址,需要对其进行解码,例如使用浏览器控制台:
id 的值即为 websiteKey。

对于 Yidun Enterprise:
与普通 Yidun 验证码类似,可以在以 get?referer= 或 check?referer= 开头的请求中找到 websiteURL、websiteKey 和 yidunApiServerSubdomain。

yidunGetLib
负责在页面上加载验证码的 JavaScript 文件路径通常可以在网络请求中找到。其名称通常类似于 load.min.js。

challenge, hcg, hct
所有这些参数都可以在网络请求中找到。相应请求通常以 cscPreprocess?reflushCode= 开头。

使用 SDK 库
- JavaScript
- Python
- C#
显示代码(用于浏览器)
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, YidunRequest } from '@zennolab_com/capmonstercloud-client';
const API_KEY = "YOUR_API_KEY"; // 输入您的 CapMonster Cloud API 密钥
document.addEventListener("DOMContentLoaded", async () => {
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: API_KEY })
);
// 基本示例,无需代理
// CapMonster Cloud 会自动使用它们的代理
let yidunRequest = new YidunRequest({
websiteURL: "https://www.example.com", // 包含验证码的页面 URL
websiteKey: "6cw0f0485d5d46auacf9b735d20218a5", // 替换为正确的值
userAgent: "userAgentPlaceholder"
});
// 使用您自己的代理的示例
// 如果想使用自己的代理,请取消注释以下代码块
/*
const proxy = {
proxyType: "http",
proxyAddress: "123.45.67.89",
proxyPort: 8080,
proxyLogin: "username",
proxyPassword: "password"
};
yidunRequest = new YidunRequest({
websiteURL: "https://www.example.com",
websiteKey: "6cw0f0485d5d46auacf9b735d20218a5",
userAgent: "userAgentPlaceholder",
proxy
});
*/
// 如有必要,可以检查余额
const balance = await client.getBalance();
console.log("Balance:", balance);
const result = await client.Solve(yidunRequest);
console.log("Solution:", result);
});
显示代码 (Node.js)
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, YidunRequest } from '@zennolab_com/capmonstercloud-client';
const API_KEY = "YOUR_API_KEY"; // 输入您的 CapMonster Cloud API 密钥
async function solveYidun() {
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: API_KEY })
);
// 基本示例,无需代理
// CapMonster Cloud 会自动使用它们的代理
let yidunRequest = new YidunRequest({
websiteURL: "https://www.example.com", // 包含验证码的页面 URL
websiteKey: "6cw0f0485d5d46auacf9b735d20218a5", // 替换为正确的值
userAgent: "userAgentPlaceholder"
});
// 使用您自己的代理的示例
// 如果想使用自己的代理,请取消注释以下代码块
/*
const proxy = {
proxyType: "http",
proxyAddress: "123.45.67.89",
proxyPort: 8080,
proxyLogin: "username",
proxyPassword: "password"
};
yidunRequest = new YidunRequest({
websiteURL: "https://www.example.com", // 含有验证码的页面 URL
websiteKey: "6cw0f0485d5d46auacf9b735d20218a5",
userAgent: "userAgentPlaceholder",
proxy
});
*/
// 如有必要,可以检查余额
const balance = await client.getBalance();
console.log("Balance:", balance);
const result = await client.Solve(yidunRequest);
console.log("Solution:", result);
}
solveYidun().catch(err => console.error("错误:", err));
显示代码
# https://github.com/ZennoLab/capmonstercloud-client-python
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import YidunRequest
# from capmonstercloudclient.requests.baseRequestWithProxy import ProxyInfo # 如果计划使用代理,请取消注释
API_KEY = "YOUR_API_KEY" # 输入您的 CapMonster Cloud API 密钥
async def solve_yidun_captcha():
client_options = ClientOptions(api_key=API_KEY)
cap_monster_client = CapMonsterClient(options=client_options)
# 基本示例,无需代理
# CapMonster Cloud 会自动使用它们的代理
yidun_request = YidunRequest(
websiteUrl="https://www.example.com", # 包含验证码的页面 URL
websiteKey="6cw0f0485d5d46auacf9b735d20218a5", # 替换为正确的值
userAgent="userAgentPlaceholder"
)
# 使用您自己的代理的示例
# 如果想使用自己的代理,请取消注释以下代码块
# proxy = ProxyInfo(
# proxyType="http",
# proxyAddress="123.45.67.89",
# proxyPort=8080,
# proxyLogin="username",
# proxyPassword="password"
# )
#
# yidun_request = YidunRequest(
# websiteUrl="https://www.example.com",
# websiteKey="6cw0f0485d5d46auacf9b735d20218a5",
# userAgent="userAgentPlaceholder",
# proxy=proxy
# )
# 如有必要,可以检查余额
balance = await cap_monster_client.get_balance()
print("Balance:", balance)
result = await cap_monster_client.solve_captcha(yidun_request)
print("Solution:", result)
asyncio.run(solve_yidun_captcha())
显示代码
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
using System;
using System.Threading.Tasks;
using Zennolab.CapMonsterCloud;
using Zennolab.CapMonsterCloud.Requests;
class Program
{
static async Task Main(string[] args)
{
// 输入您的 CapMonster Cloud API 密钥
var clientOptions = new ClientOptions
{
ClientKey = "YOUR_API_KEY"
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
// 基本示例,无需代理
// CapMonster Cloud 会自动使用它们的代理
var yidunRequest = new YidunTaskRequest
{
WebsiteUrl = "https://example.com", // 包含验证码的页面 URL
WebsiteKey = "7ce0f0475b5d46acacf9b732a29218d9", // 替换为正确的值
UserAgent = "userAgentPlaceholder"
};
// 使用您自己的代理的示例
// 如果想使用自己的代理,请取消注释以下代码块
/*
var yidunRequest = new YidunTaskRequest
{
WebsiteUrl = "https://example.com",
WebsiteKey = "6ce0f0475b5d46acacf9b732d29218d8",
UserAgent = "userAgentPlaceholder",
Proxy = new ProxyContainer(
"123.45.67.89",
8080,
ProxyType.Http,
"username",
"password"
)
};
*/
// 如有必要,可以检查余额
var balance = await cmCloudClient.GetBalanceAsync();
Console.WriteLine("Balance: " + balance);
var yidunResult = await cmCloudClient.SolveAsync(yidunRequest);
Console.WriteLine("Solution: " + yidunResult.Solution.Value);
}
}
