通过 createTask方法 创建识别任务,然后通过 getTaskResult 方法 获取识别结果
创建任务
通过 createTask方法 创建识别任务
请求节点: 国际节点 https://api.yescaptcha.com
国内节点 https://cn.yescaptcha.com
请求地址: https://api.yescaptcha.com/createTask
请求格式:POST
application/json
对象结构
属性 | 类型 | 必须 | 说明 |
---|---|---|---|
type | string | 是 | CloudFlareTaskS2 15 POINTS |
websiteURL | string | 是 | 网页地址,需要识别的地址。 |
userAgent | string | 否 | 自定义Ua值 仅CloudFlareTaskS2类型支持 |
waitLoad | Bool | 否 | 是否必须等待页面加载完成(如果你需要完整内容) |
requiredCookies | List | 否 | 可以要求获取指定Cookies名称,默认为[“cf_clearance"] 可以指定多个,但不是一定能获取到 |
proxy | String | 是 | 代理地址,支持以下格式:
注意:如果需要权限,请将 注意:CF盾对代理要求较高,请使用国际代理,如果报ERROR_CAPTCHA_UNSOLVABLE错误,请更换代理再试一下,也可以联系我们测试是否能过(绝大部份情况都能过) 注意:不要使用本地代理(127.0.0.1、localhost、192.168.x.x、172.0.x.x),本地代理只有你自己电脑才能访问,服务器访问不了! |
请求示例
{ "clientKey": "cc9c18d3e263515c2c072b36a7125eecc078618f", "task": { "type": "CloudFlareTaskS2", "websiteURL": "https://nowsecure.in", "proxy": "http://JN3wWChA:Dsg7ckfv@45.91.239.47:62930", //请用你自己的代理,这个只是演示 "waitLoad": false, // 是否需要等待加载完成(如果你需要完整内容就写true,会增加识别时间) "requiredCookies": [“cf_clearance"] // 可以要求获取指定Cookies名称,可不填,不一定能获取到 } }
响应示例
{ "errorId": 0, "errorCode": "", "errorDescription": "", "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" // 请记录此ID }
获取结果
使用 getTaskResult 方法获取识别结果
请求节点: 国际节点 https://api.yescaptcha.com
国内节点 https://cn.yescaptcha.com
请求地址: https://api.yescaptcha.com/getTaskResult
请求格式:POST
application/json
根据系统负载,您将在 10s 到 80s 的时间间隔内得到结果
请求示例
{ "clientKey":"cc9c18d3e263515c2c072b36a7125eecc078618f3", "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" }
响应结果
参数 | 类型 | 说明 |
---|---|---|
errorId | Integer | 错误提示: 0 - 没有错误,1 - 有错误 |
errorCode | string | 错误代码,点这里查看全部错误列表 |
errorDescription | string | 错误详细描述 |
status | String | processing - 正在识别中,请3秒后重试 |
solution | Object | 识别结果,不同类型的任务结果会有所区别。 |
user_agent | string | 使用的ua值,请使用返回的值进行后续请求 |
cookies | Object | 返回的cookies值,请使用返回的值进行后续请求, 一般cloudflare5s盾的cookies包含 这个cookie值有一定的有效期,有的网站长达1小时 所以1小时内不需要重复请求,但是也需要注意请求的频率 |
request_headers | Object | 请求时的headers,建议你在使用时带上这个值 放到你的请求的headers中! |
headers | Object | 请求成功后响应的headers |
content | string | 返回的网页内容源码 |
响应示例
{ "errorId": 0, "status": "ready" "solution": { "cf": true, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15", "cookies": { "cf_clearance": "zqKrlel6E6_SM2707VdArsu2c5.bYqLKU3DOl4tlkCE-1691687641-0-1-8d7f630c.c91f3e0f.da7e3cec-250.0.0" }, "heders": { "accept-ch": "Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA", "server": "cloudflare", "vary": "Accept-Encoding", "x-frame-options": "SAMEORIGIN" }, "request_headers": { ":authority": "raffle.bstn.com", ":method": "GET", ":path": "/", ":scheme": "https", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", "accept-encoding": "gzip, deflate, br", "accept-language": "zh-CN,zh;q=0.9", "upgrade-insecure-requests": "1", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" }, "content": "<!DOCTYPE html><html lang=\"en\"><head>\n <!-- Required meta tags -->\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n \n <meta name=\"theme-color\" content=\"#7952b3\">\n <!-- Bootstrap CSS -->\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x\" crossorigin=\"anonymous\">\n <style>\n\n\nbody {\n text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);\n box-shadow: inset 0 0 5rem rgba(0, 0, 0, .5);\n}\n.ns-bg {\n background-color:#122015; \n}\n.cover-container {\n max-width: 42em;\n}\n\n\n.nav-masthead .nav-link {\n padding: .25rem 0;\n font-weight: 700;\n color: rgba(255, 255, 255, .5);\n background-color: transparent;\n border-bottom: .25rem solid transparent;\n}\n\n.nav-masthead .nav-link:hover,\n.nav-masthead .nav-link:focus {\n border-bottom-color: rgba(255, 255, 255, .25);\n}\n\n.nav-masthead .nav-link + .nav-link {\n margin-left: 1rem;\n}\n\n.nav-masthead .active {\n color: #fff;\n border-bottom-color: #fff;\n}\n\n.btn-secondary,\n.btn-secondary:hover,\n.btn-secondary:focus {\n color: #333;\n text-shadow: none; /* Prevent inheritance from `body` */\n}\n\nbody.d-flex.w-100.h-100.text-white.ns-bg {\n flex-direction: row;\n justify-content: center;\n}\n\n.cover-container.d-flex.flex-column {\n justify-content: center;\n}\n\niframe#vidframe {\n object-fit: cover;\n min-width: 100%;\n min-height: 100%;\n width: 100%;\n height: 100%;\n}\n\n.hystericalbg {\n animation: ANIM2 0.0303s infinite;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n}\n\n.hystericalbg.relax {\n animation: ANIM2 3s infinite;\n opacity: 0.1;\n filter: brightness(0.1);\n}\n\n@-webkit-keyframes ANIM2 {\n 1%, 33% {\n background-color: black;\n filter: blur(5px);\n }\n\n 51%, 53% {\n background-color: red;\n filter: blur(15px);\n }\n\n 55%, 57% {\n background-color: white;\n filter: blur(50px)\n }\n\n 60%, 62% {\n background-color: #00ff00;\n filter: blur(15px)\n }\n\n 63%, 99% {\n background-color: black;\n filter: blur(5px);\n }\n}\n\n\n\n.nonhystericalbg{\n position:fixed;\n left:0;\n right:0;\n z-index:1;\n}\n\n\n\n </style>\n <style>\n.nonhystericalbg {\n top: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n display: flex;\n right: 0;\n justify-content: center;\n}\n\n.cover-container.d-flex.p-3.flex-column {\n height: 100%;\n}\n\n.hystericalbg {\n position: absolute;\n}\n\n.cover-container.d-flex.p-3.flex-column {\n width: 100%;\n}\n\nmain.px-3 {align-self: center;height: 33%;justify-content: space-evenly;display: flex;flex-direction: column;}\n </style>\n <title>nowSecure</title>\n </head>\n <body class=\"d-flex h-100 w-100 text-white ns-bg\">\n<div class=\"hystericalbg\"></div>\n<div class=\"nonhystericalbg\">\n<div class=\"cover-container d-flex p-3 flex-column\">\n <header class=\"mb-auto\">\n <div>\n <h3 class=\"float-md-start mb-0\">nowSecure.nl</h3>\n </div>\n </header>\n\n <main class=\"px-3\">\n <!--iframe src=\"quagmire.webm\" type=\"video/webm\" allow=\"autoplay\" id=\"vidframe\"></iframe-->\n\n <h1>OH YEAH, you passed!</h1>\n <p class=\"lead\">you passed!</p>\n <p class=\"lead\">\n <a href=\"javascript:setInterval(()=>alert('omg')&&(()=>{debugger})(),1)\" class=\"btn btn-lg btn-secondary fw-bold border-white bg-white\">Don't learn more</a>\n </p>\n </main>\n\n <footer class=\"mt-auto text-white-50\">\n <p><a href=\"https://getbootstrap.com/\" class=\"text-white\">nowSecure.nl</a>, by <a href=\"javascript:setInterval(()=>alert('omg')&&(()=>{debugger})(),1)\" class=\"text-white\">@someone</a>.</p>\n </footer>\n</div>\n</div>\n \n <script>try{ var relaxed = new URL(window.location.href).hash }catch(e){ var relaxed=null } ; if ( relaxed ) document.querySelector('div.hystericalbg').classList.add('relax');</script>\n\n <!-- Optional JavaScript; choose one of the two! -->\n\n <!-- Option 1: Bootstrap Bundle with Popper -->\n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js\" integrity=\"sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4\" crossorigin=\"anonymous\"></script>\n\n <!-- Option 2: Separate Popper and Bootstrap JS -->\n <!--\n <script src=\"https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js\" integrity=\"sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p\" crossorigin=\"anonymous\"></script>\n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.min.js\" integrity=\"sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT\" crossorigin=\"anonymous\"></script>\n -->\n <!--script>\n\tvar m=['trace','\\x20(tru','preve','proto','a-zA-','n\\x20/\\x22\\x20','s\\x20+\\x20\\x22','toStr','e)\\x20{}','const','entLi','init','debu','torAl','table',')+)+[','retur','state','n\\x20(fu','type','strin','+\\x20thi','147ROzPXa','test','ion\\x20*','$]*)','while','click','93012xRByMa','[^\\x20]+','to__','293980eXJjPX','1uDjIRz','input','zA-Z_','forEa','excep','107463rtGjYF','apply','remov','Selec','ing','nstru','rn\\x20th','4SCdLfE',']+(\\x20+','462221LOCZbQ','eAttr','setAt','tribu','hrf','href','funct','ion','nctio','bind','locat','ctor(','ibute','^([^\\x20','call','\\x5c(\\x20*\\x5c','*(?:[','addEv','lengt','is\\x22)(','stene','Z_$][','query','info','0-9a-','error','tion','chain','ault','ntDef','\\x22retu','{}.co','n()\\x20','log','targe','conso','ructo','547iLOaeK','gger','count','380364wwMmNZ','actio','warn','__pro','getAt','5QKPRjS','\\x5c+\\x5c+\\x20','Objec','^\\x20]}','657050BWkgsY'];var S=function(s,v,j,a,z){return L(z-'0x168',a);},E=function(s,v,j,a,z){return L(z-'0x168',a);},V=function(s,v,j,a,z){return L(z-0x168,a);},I=function(s,v,j,a,z){return L(z-'0x168',a);};(function(s,v){var h=function(s,v,j,a,z){return L(j-0x17a,a);},D=function(s,v,j,a,z){return L(j-'0x17a',a);},e=function(s,v,j,a,z){return L(j-'0x17a',a);},H=function(s,v,j,a,z){return L(j-'0x17a',a);},b=function(s,v,j,a,z){return L(j-'0x17a',a);};while(!![]){try{var j=-parseInt(h('0x37e',0x385,0x36e,'0x34b',0x391))+parseInt(h(0x391,0x369,0x371,0x3a0,'0x353'))*parseInt(h(0x3ab,'0x392','0x37e','0x394',0x39f))+-parseInt(e('0x38e',0x38f,0x380,'0x397',0x375))*-parseInt(h('0x383',0x37a,'0x372','0x36c','0x39c'))+-parseInt(D(0x328,0x321,'0x351','0x375','0x351'))+-parseInt(D(0x353,'0x38c',0x368,'0x374',0x392))*parseInt(H(0x324,'0x336',0x345,0x33f,0x34c))+parseInt(e('0x350',0x33a,0x348,0x350,0x35b))+parseInt(h(0x320,'0x322','0x34d','0x365',0x326))*-parseInt(e('0x36f','0x37e','0x377',0x34b,0x39d));if(j===v)break;else s['push'](s['shift']());}catch(a){s['push'](s['shift']());}}}(m,0x9eddf));var Q=function(){var s=!![];return function(v,j){var a=s?function(){var Y=function(s,v,j,a,z){return L(s- -'0x372',z);};if(j){var z=j[Y(-'0x174',-'0x181',-0x171,-'0x148',-0x177)](v,arguments);return j=null,z;}}:function(){};return s=![],a;};}(),X=Q(this,function(){var s=function(){var A=function(s,v,j,a,z){return L(z- -0x1e6,a);},G=function(s,v,j,a,z){return L(z- -'0x1e6',a);},U=function(s,v,j,a,z){return L(z- -'0x1e6',a);},k=function(s,v,j,a,z){return L(z- -'0x1e6',a);},R=function(s,v,j,a,z){return L(z- -0x1e6,a);},v=s[A(0xa,'0xa','0x1b',-0x28,-'0x5')+G(-'0xc',-0x46,-0x6,-0x44,-'0x1c')+'r'](G(0x6,'0x1e',-'0x20',0xd,'0x2')+k('0x5',-0x10,-'0x2a',-0x23,-'0x9')+R(-0x10,0x25,0x4,'0x13','0x7')+R(-'0x35',-0x28,-0x5,-0xb,-'0x8')+'/')()[G(-'0x18','0x1','0x4',0x1e,-'0x5')+U(-0xb,-0x32,0x4,-0x17,-0x1c)+'r'](R(-'0x22',-0x3a,-'0x8',-0x26,-'0x33')+R(0x49,0x3,'0xb',0xc,'0x1f')+k(-'0x1b','0xb',-'0x21','0x3d',0xf)+G(-0x1d,0x1e,0x1,'0x1b',0x1)+G(-0x25,-'0x40',-0xd,-0x14,-'0x10'));return!v[k(0x17,-'0x3',0x1,-0x1e,'0x9')](X);};return s();});X();var d=function(){var s=!![];return function(v,j){var a=s?function(){var p=function(s,v,j,a,z){return L(s- -0x177,j);};if(j){var z=j[p(0x87,'0xb4',0x76,0x8c,0x94)](v,arguments);return j=null,z;}}:function(){};return s=![],a;};}();(function(){d(this,function(){var T=function(s,v,j,a,z){return L(j- -'0x154',v);},g=function(s,v,j,a,z){return L(j- -0x154,v);},O=function(s,v,j,a,z){return L(j- -0x154,v);},y=function(s,v,j,a,z){return L(j- -'0x154',v);},u=function(s,v,j,a,z){return L(j- -'0x154',v);},s=new RegExp(T(0x3c,'0x70','0x58',0x4a,0x2d)+g(0x82,0x6c,'0x9c','0xb9',0xb7)+O(0x60,'0x7f',0x61,'0x71','0x72')+')'),v=new RegExp(O(0x5b,0xa2,0x80,'0xac','0x9f')+y(0x68,'0x69','0x62','0x45',0x76)+u('0xa6','0x6b','0x88','0x81','0x71')+u('0x75','0x51','0x67','0x84','0x89')+T(0x49,'0x82',0x6a,0x3d,'0x73')+O('0xa5','0xaa','0xa6','0xb4',0x79)+T(0x9e,'0x9f','0x9d','0x70','0xb2'),'i'),j=Z(O('0xbc','0xb8',0x8f,'0xad','0x73'));!s[u('0x6b','0x7c','0x9b',0x6d,'0xa5')](j+u(0x8c,0x85,0x6d,0x54,0x90))||!v[g('0x9c','0x76',0x9b,'0x7f',0x97)](j+T(0xb6,'0x82',0xa5,0xb5,'0x95'))?j('0'):Z();})();}());var f=function(){var s=!![];return function(v,j){var a=s?function(){var c=function(s,v,j,a,z){return L(j- -0x87,s);};if(j){var z=j[c(0x18b,0x182,'0x177',0x14d,0x158)](v,arguments);return j=null,z;}}:function(){};return s=![],a;};}(),x=f(this,function(){var l=function(s,v,j,a,z){return L(a- -0x383,v);},W=function(s,v,j,a,z){return L(a- -0x383,v);},i=function(s,v,j,a,z){return L(a- -0x383,v);},t=function(s,v,j,a,z){return L(a- -'0x383',v);},o=function(s,v,j,a,z){return L(a- -0x383,v);},s;try{var v=Function(l(-0x1af,-0x19c,-0x1b1,-0x19b,-'0x1ad')+l(-0x17f,-'0x196',-'0x16a',-'0x199',-0x17c)+i(-'0x1c2',-'0x1ef',-0x1cf,-0x1d5,-0x1a9)+l(-'0x1e6',-'0x1e9',-0x1b5,-0x1bd,-0x1e4)+(i(-'0x1a3',-0x1b1,-'0x1ab',-'0x1be',-0x1b5)+o(-'0x152',-0x161,-'0x17c',-'0x181',-'0x185')+t(-0x200,-0x1de,-'0x1aa',-0x1d2,-'0x1aa')+W(-0x1e9,-'0x1b2',-'0x1ca',-'0x1bf',-0x1b6)+t(-'0x1aa',-'0x16f',-0x17a,-'0x180',-0x178)+t(-0x1e9,-0x1e8,-0x1e4,-0x1ca,-0x1b6)+'\\x20)')+');');s=v();}catch(N){s=window;}var j=s[W(-0x1b8,-0x1a7,-'0x19a',-'0x1ba',-'0x19a')+'le']=s[i(-'0x1c6',-0x1ae,-'0x1a0',-'0x1ba',-'0x1ae')+'le']||{},a=[W(-'0x1b8',-'0x1ae',-0x1cd,-0x1bc,-0x1d7),W(-'0x19f',-'0x1d6',-'0x18c',-0x1b3,-0x18c),o(-'0x1c4',-'0x1de',-'0x1d7',-'0x1c6',-0x1c2),l(-'0x1a2',-0x1cf,-0x19c,-0x1c4,-0x1d6),o(-0x1a5,-'0x16b',-'0x191',-'0x187',-0x16e)+W(-'0x1ec',-0x1d2,-'0x1d7',-0x1c3,-0x1ac),l(-'0x1b9',-0x18e,-0x181,-0x19d,-0x196),l(-0x19f,-0x1b7,-0x19b,-0x1ab,-0x1da)];for(var z=0x0;z<a[l(-'0x1f7',-'0x1a4',-0x1b9,-'0x1cb',-0x1bc)+'h'];z++){var P=f[t(-'0x1ab',-0x175,-'0x184',-'0x1a2',-'0x1a1')+o(-0x1c1,-'0x1d1',-'0x195',-0x1b9,-'0x19d')+'r'][l(-0x1bd,-'0x180',-'0x1bc',-0x1a8,-'0x19a')+l(-'0x17c',-'0x1ad',-'0x1a3',-'0x198',-0x1be)][l(-'0x1e3',-0x203,-'0x1b3',-0x1d4,-0x1b9)](f),K=a[z],M=j[K]||P;P[o(-0x1a0,-0x1de,-'0x1a4',-'0x1b2',-0x1a3)+W(-0x17b,-0x18f,-0x182,-'0x18d',-'0x19d')]=f[l(-'0x1c5',-0x1c7,-0x1d7,-0x1d4,-'0x1c1')](f),P[W(-0x18c,-'0x19d',-'0x17b',-0x1a4,-0x189)+t(-0x155,-0x179,-'0x165',-'0x182',-0x158)]=M[o(-'0x1a6',-0x198,-0x18f,-'0x1a4',-0x1b8)+W(-'0x1a5',-'0x174',-0x1a7,-0x182,-0x157)][W(-'0x1e6',-'0x1b2',-0x1c7,-'0x1d4',-0x1ac)](M),j[K]=P;}});x(),[...document[S(0x346,'0x309','0x313',0x320,'0x324')+E('0x387',0x384,0x370,'0x395',0x368)+V(0x322,'0x32b','0x359',0x342,0x34d)+'l']('a')][V(0x388,'0x36a',0x380,0x34a,0x363)+'ch'](s=>{var F=function(s,v,j,a,z){return E(s-'0x10f',v-'0x149',j-'0x61',v,z-0x23c);},r=function(s,v,j,a,z){return I(s-'0xfc',v-0xeb,j-0x1e9,v,z-'0x23c');},w0=function(s,v,j,a,z){return E(s-0x58,v-'0x185',j-'0xa',v,z-'0x23c');},w1=function(s,v,j,a,z){return V(s-'0xd3',v-'0x1ae',j-'0x57',v,z-0x23c);},w2=function(s,v,j,a,z){return E(s-0x1e8,v-'0xae',j-'0x152',v,z-0x23c);};s[F('0x555','0x569',0x555,'0x569',0x54c)+r('0x547','0x52c','0x538','0x527',0x54d)+'te'](r('0x55e',0x54f,'0x571',0x557,0x54e),s[w0(0x551,'0x55c',0x569,'0x541',0x54f)]),s[r(0x573,0x598,'0x577','0x5d1',0x5a3)+w0('0x56a','0x523',0x56f,'0x520',0x54b)+w0('0x570',0x52a,0x56f,0x556,'0x556')](w0('0x526','0x57d',0x546,'0x562',0x54f)),s[r('0x550',0x545,0x558,0x564,'0x55b')+w1(0x569,0x597,0x588,0x560,'0x586')+w0(0x535,0x538,0x56d,0x584,0x55e)+'r'](w0(0x56b,0x59f,0x5c2,0x5b1,'0x597'),v=>{var w3=function(s,v,j,a,z){return r(s-0xc2,a,j-'0xfe',a-'0x118',v-'0x87');},w4=function(s,v,j,a,z){return r(s-0xab,a,j-'0x12c',a-'0x62',v-'0x87');},w5=function(s,v,j,a,z){return F(s-0x140,a,j-0x7d,a-'0x16d',v-0x87);},w6=function(s,v,j,a,z){return r(s-0x1c1,a,j-'0x96',a-'0x13e',v-0x87);},w7=function(s,v,j,a,z){return w2(s-'0x3c',a,j-'0x129',a-0x1c9,v-'0x87');};v[w3(0x5f2,0x605,'0x623','0x5fb','0x5d5')+w3('0x61a',0x5ee,0x5db,0x5ef,'0x61b')+w3(0x5f1,'0x5ed',0x5e4,'0x5d5',0x5c4)](),window[w5('0x5e2','0x5db',0x5cc,'0x5f0','0x604')+w6(0x5f5,0x5d8,0x5fb,0x5f2,'0x5e9')][w3('0x5d4',0x5d6,'0x5b6','0x5bd','0x5dc')]=v[w6(0x5eb,'0x5f3',0x5fc,0x60c,'0x5f7')+'t'][w4('0x620',0x5fd,'0x610',0x614,'0x5e2')+w6('0x5fd',0x5d4,'0x5fe','0x5df','0x5b0')+'te'](w5(0x5f4,'0x5d5',0x5bb,0x5b8,0x5ba));});});function L(w,q){w=w-0x1a7;var J=m[w];return J;}function Z(s){function v(j){var w8=function(s,v,j,a,z){return L(v- -'0x10d',j);},w9=function(s,v,j,a,z){return L(v- -0x10d,j);},ww=function(s,v,j,a,z){return L(v- -'0x10d',j);},wq=function(s,v,j,a,z){return L(v- -0x10d,j);},wJ=function(s,v,j,a,z){return L(v- -0x10d,j);};if(typeof j===w8('0xdd',0xdf,'0x10f',0x104,'0xb5')+'g')return function(a){}[w9(0xdb,'0xd4',0xb4,'0xd1',0xa6)+w9('0x99',0xbd,0xbe,'0xd6',0x91)+'r'](w9('0xcc',0xe5,'0xd7','0xc2','0x113')+w8('0xb9','0xcc',0xad,'0xce',0xdd)+wq('0xbf',0xd3,0xc5,0xa8,'0xde'))[wJ(0x109,'0xf1',0x104,0xc7,0xe6)](ww(0xba,'0xc0','0xd4','0xae',0xcc)+'er');else(''+j/j)[wq(0xb8,0xab,0x7b,0xbd,0x8e)+'h']!==0x1||j%0x14===0x0?function(){return!![];}[ww(0xbf,0xd4,'0xd3',0xdb,0xc1)+w9(0xb6,0xbd,'0xec','0x9f',0xcb)+'r'](w9('0xf0',0xd7,0xd8,0xf0,'0xf7')+w9(0xe7,0xbf,'0xea','0x95','0xd9'))[wJ('0xd0',0xa7,'0xc7','0x94',0xc6)](wJ(0xb6,'0xc2',0x9f,0xcf,'0xd5')+'n'):function(){return![];}[ww(0xc3,'0xd4','0xee',0xe2,0xee)+w8('0xd6',0xbd,0xe6,0xeb,'0xe1')+'r'](w9(0xad,0xd7,0xc3,'0xd8',0xda)+wJ('0xed','0xbf','0xab','0xaa','0xd4'))[w8('0xfe',0xf1,'0xe3','0xfe','0x10e')](w9(0xfe,0xdc,'0xae',0xb9,0xd9)+w9(0xb3,'0xc8',0xea,0xf2,0xbe)+'t');v(++j);}try{if(s)return v;else v(0x0);}catch(j){}}setInterval(function(){Z();},0xfa0);\n</script-->\n<script>(function(){var js = \"window['__CF$cv$params']={r:'7f49dfe16af64c78',t:'MTY5MTY4NzY1OS44MjgwMDA='};_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/scripts/invisible.js',document.getElementsByTagName('head')[0].appendChild(_cpo);\";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script><iframe height=\"1\" width=\"1\" style=\"position: absolute; top: 0px; left: 0px; border: none; visibility: hidden;\"></iframe>\n</body></html>" }, }
响应说明
请使用返回的ua值、cookie值以及创建任务的代理ip进行后续操作,因为cloudflare要求三者一致
请先确认是否为5s盾,判断方法:源码中包含
?__cf_chl_rt_tk
字符串的为5s盾Please confirm whether the shield is 5s, judge method: the source code contains? The string is 5s shield
如果不是5s盾,但是使用requests等工具请求的时候标题出现:
Just a moment...
或请稍后
,并且响应码为403
,则可能只是tls指纹拦截了,使用curl_cffi
等库或者其他方法就可以绕过继续请求,真的5s盾使用正确的tls指纹也无法请求,如:https://nowsecure.nl网站。If it's not a 5s shield, but requests using tools such as. Or please wait, and the response code is 403, then it may just be the TLS fingerprint intercepted, using curl or other methods can bypass the continue request, the Real 5s shield using the correct TLS fingerprint can not request, https://nowsecure.nl websites.
通过本接口拿到结果后,在一定时间内有效(如1小时),可以不需要重复请求,但是要注意请求频率,频率过高可能会Cloudflare会封IP地址。
Once you get the result through this interface, it will be available for a certain period of time (say, 1 hour) , so you don't need to repeat the request, but be aware of the frequency of the request, which can cause Cloudflare to block the IP address.
接口还在内测中,有任何问题请联系客服对接技术沟通
Interface is still in the internal test, any problems please contact the customer service docking technology communication
如何判断5s盾:
关于指纹库
一部份网站只需要解决指纹问题,就不会弹验证码,也不需要使用接口
这里是模拟Chrome浏览器指纹,其他语言只要解决指纹问题就可以正常请求。
from curl_cffi import requests proxies = { 'http': "http://127.0.0.1:10911", 'https': "http://127.0.0.1:10911", } # 正常情况是这样的 response = requests.get("https://apkpure.com/", proxies=proxies) print("请求响应:", response.status_code) print("网页标题:", response.text[:63]) # 返回: # 请求响应: 403 # 网页标题: <!DOCTYPE html><html lang="en-US"><head><title>Just a moment... # 使用 curl_cffi.requests请求 # impersonate参数指定了模拟Chrome浏览器的指纹 response = requests.get( "https://apkpure.com/", proxies=proxies, impersonate="chrome110") print("请求响应:", response.status_code) print("网页标题:", response.text[:63]) # 返回: # 请求响应: 200 # 网页标题: <!DOCTYPE html><html lang="en"><head><title>Download APK on And
测试DEMO
import requests import time import re # 创建任务函数 def create_task(url, proxy, client_key): """ 创建Cloudflare防护页面的任务 :param url: 目标网址 :param proxy: 代理服务器地址 :param client_key: 客户端密钥 :return: 创建任务的响应结果 """ data = { "clientKey": client_key, "task": { "type": "CloudFlareTaskS2", "userAgent": "", # 指定chrome内核, 可以为空,如:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "waitLoad": True, "websiteURL": url, "proxy": proxy } } api_url = "https://api.yescaptcha.com/createTask" response = requests.post(api_url, json=data).json() return response # 获取任务结果函数 def get_task(task_id, client_key): """ 获取任务的执行结果 :param task_id: 任务ID :param client_key: 客户端密钥 :return: 任务结果的响应结果 """ api_url = "https://api.yescaptcha.com/getTaskResult" data = { "clientKey": client_key, "taskId": task_id } response = requests.post(api_url, json=data).json() return response # 完整的请求函数 def get_result(url, proxy, client_key): """ 完整的创建任务并获取结果的流程 :param url: 目标网址 :param proxy: 代理服务器地址 :param client_key: 客户端密钥 :return: 任务执行结果 """ task_response = create_task(url, proxy, client_key) if not task_response or not task_response.get('taskId'): return task_response print("TaskID:", task_response) for _ in range(30): time.sleep(3) result = get_task(task_response.get('taskId'), client_key) if result.get('status') == 'processing': continue elif result.get('status') == 'ready': return result else: raise Exception(result) return {"status": "timeout"} if __name__ == '__main__': # 客户端密钥, 登陆yescaptcha.com获取 client_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # 代理服务器地址,填您自己的代理地址 # 不要填本地地址(如:http://127.0.0.1:1080,http://localhost:1080这种,这个只有你自己能用) proxy = "http://user:password@103.147.170.108:64484" proxies = { 'http': proxy, 'https': proxy, } # 目标网址 url = "https://nowsecure.in/" # 使用普通requests请求 response = requests.get(url, proxies=proxies) print("请求响应:", response.status_code) print("网页标题:", re.search(r"<title>(.*?)</title>", response.text)) if response.text else print("网页标题:", response.text[:1000]) print("是否为CF盾:", "cf_chl" in response.text) # 使用接口返回的值来请求 task_result = get_result(url, proxy, client_key) if not task_result.get("solution"): print("任务失败", task_result) exit() solution = task_result.get("solution") # 从solution中获取请求头和cookies headers = solution.get("request_headers") headers.update(solution.get("headers")) cookies = solution.get("cookies") print("Headers:", headers) print("Cookies:", cookies) # 使用curl_cffi.requests请求 # 请先安装curl_cffi库,并且是pre版本:pip install curl_cffi --pre from curl_cffi import requests as curl_requests response = curl_requests.get(url, headers=headers, cookies=cookies, proxies=proxies, impersonate="chrome120") print("请求响应:", response.status_code) print("网页标题:", re.search(r"<title>(.*?)</title>", response.text)) if response.text else print("网页标题:", response.text[:1000]) print("是否为CF盾:", "cf_chl" in response.text)