代码拉取完成,页面将自动刷新
//接码平台API-V4.0
//From.TheHot.2019.3.18
//使用前请仔细查看以下参数
//下面注释块中为指定变量,请复制到脚本中,并且放置到最前方
//关于函数返回值,成功返回 结果 或 0,失败返回 -1
/*
var 接码平台 = "易码"; //关键词(共享、短租、火云、易码、芒果云、樱桃云、吸码皇、TheWolf),其他平台有待添加。
var 平台账号 = ""; //登陆用户名或API(部分平台需要用API账号,请前往电脑端获取)
var 登陆密码 = ""; //登陆密码
var 项目ID = ""; //接码项目ID
var 虚拟号设置 = "0"; //0为正常号段,1为虚拟号段,为空则随机
eval(http.get('https://gitee.com/thehot/auto/raw/master/TModules.js').body.string());
*/
//变量转换
var CodePlatform = 接码平台;
var Account_Api = 平台账号;
var PassWord = 登陆密码;
var Project_ID = 项目ID;
var Provinces = ""; //是否按省份获取,为空则随机,省份按照平台显示名称填写
var PhoneType = ""; //CMCC 为移动,UNICOM 为联通,TELECOM 为电信,为空则随机
var vno = 虚拟号设置;
//易码特殊设置项
if (vno == 0) {
var excludeno = "170.171.180";
var filterPrefix = "170,171,180";
} else {
var excludeno = "";
}
//芒果云、樱桃云特殊项设置
if(CodePlatform == "芒果云" && CodePlatform == "樱桃云"){
if(vno == 0){
vno = 1;
}else if(vno == 1){
vno = 0;
}else{
vno = vno;
}
}
var ProvincesCode = ""; //易码平台省份设置(填写省份代码,易码平台获取)
var isp = ""; //号码所属运营商代码。1:移动,2:联通,3:电信,为空则随机
//接码平台API地址
var gx_api = "http://api.ipadh.cn/do.php?action=";
var hy_api = "http://huoyun888.cn/api/do.php?action=";
var dz_api = "http://api.jmyzm.com/http.do?action=";
var ym_api = "http://api.fxhyd.cn/UserInterface.aspx?action=";
var dm_api = "http://api.duomi01.com/api?action=";
var xmh_api = "http://www.ximahuang.com/alz/api?action=";
var mgy_api = "http://www.mangopt.com:9000/doApi/";
var yty_api = "http://www.cherryun.com:8000/doApi/";
var TheWolf_api = "http://api.dk827.com/index.php/";
var storage = storages.create("TheWolf");
if (CodePlatform == "TheWolf") {
if (storage.contains("token") == true) {
if (verification_token() == 0) {
var LoginToken = storage.get("token");
} else {
var LoginToken = getToken(CodePlatform);
storage.put("token", LoginToken);
}
} else {
var LoginToken = getToken(CodePlatform);
storage.put("token", LoginToken);
}
}else{
var LoginToken = getToken(CodePlatform);
}
//验证TheWolf平台token合法性
// http://api.dk827.com/index.php/token?token=381fca50d18837ae631ef870679ddca7
function verification_token(){
var r = http.get(TheWolf_api + "token?token=" + storage.get("token"));
var j = r.body.json();
if(j.errno > 0){
toastLog(j.errmsg);
return -1;
}else if(j.errno == 0){
return 0;
}
return -1;
}
//获取token值
function getToken(CodePlatform) {
switch (CodePlatform) {
case "共享":
var r = http.get(gx_api + "loginIn&name=" + Account_Api + "&password=" + PassWord);
var token = r.body.string().split("|");
if (token[0] == 0) {
toastLog(token[1]);
return -1;
}
return token[1];
case "火云":
var r = http.get(hy_api + "loginIn&name=" + Account_Api + "&password=" + PassWord);
var token = r.body.string().split("|");
if (token[0] == 0) {
toastLog(token[1]);
return -1;
}
return token[1];
case "多米":
var r = http.get(dm_api + "loginIn&name=" + Account_Api + "&password=" + PassWord);
var token = r.body.string().split("|");
if (token[0] == 0) {
toastLog(token[1]);
return -1;
}
return token[1];
case "短租":
var r = http.get(dz_api + "loginIn&uid=" + Account_Api + "&pwd=" + PassWord);
var token = r.body.string();
if (token.indexOf(Account_Api) == -1) {
toastLog("短租账号登陆失败!");
return -1;
}
token = token.split("|");
return token[1];
case "易码":
var r = http.get(ym_api + "login&username=" + Account_Api + "&password=" + PassWord);
var token = r.body.string();
if (token.indexOf("success") == -1) {
toastLog("易码账号登陆失败!");
return -1;
}
token = token.split("|");
return token[1];
case "吸码皇":
// http://www.ximahuang.com/alz/api?action=loginIn&name=API账号&password=密码&developer=开发者参数
var r = http.get(xmh_api + "loginIn&name=" + Account_Api + "&password=" + PassWord);
var token = r.body.string().split("|");
if (token[0] == 0) {
toastLog(token[1]);
return -1;
}
return token[1];
case "芒果云":
// http://www.mangopt.com:9000/doApi/loginIn?name=API账号&password=密码
var r = http.get(mgy_api + "loginIn?name=" + Account_Api + "&password=" + PassWord);
var token = r.body.string().split("|");
if (token[0] == 0) {
toastLog(token[1]);
return -1;
}
return token[1];
case "樱桃云":
// http://www.mangopt.com:9000/doApi/loginIn?name=API账号&password=密码
var r = http.get(yty_api + "loginIn?name=" + Account_Api + "&password=" + PassWord);
var token = r.body.string().split("|");
if (token[0] == 0) {
toastLog(token[1]);
return -1;
}
return token[1];
case "TheWolf":
var r = http.get(TheWolf_api + "reg/login?username=" + Account_Api + "&password=" + PassWord);
r = r.body.json();
var errno = r.errno;
if (errno > 0) {
toastLog(r.errmsg);
return -1;
} else if (errno == 0) {
toastLog("TheWolf登录成功!");
return r.ret.token;
}
default:
toast("未接入该接码平台!");
}
}
//获取手机号函数
function GetPhone(phone) {
switch (CodePlatform) {
case "共享":
if (phone != null) {
var r = http.get(gx_api + "getPhone&sid=" + Project_ID + "&token=" + LoginToken + "&phone=" + phone);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
}
var r = http.get(gx_api + "getPhone&sid=" + Project_ID + "&token=" + LoginToken + "&locationMatching=include&locationLevel=p&location=" + Provinces + "&showExtra=1&phoneType=" + PhoneType + "&vno=" + vno);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
case "火云":
if (phone != null) {
var r = http.get(hy_api + "getPhone&sid=" + Project_ID + "&token=" + LoginToken + "&phone=" + phone);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
}
var r = http.get(hy_api + "getPhone&sid=" + Project_ID + "&token=" + LoginToken + "&locationMatching=include&locationLevel=p&location=" + Provinces + "&showExtra=1&phoneType=" + PhoneType + "&vno=" + vno);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
case "多米":
if (phone != null) {
var r = http.get(dm_api + "getPhone&sid=" + Project_ID + "&token=" + LoginToken + "&phone=" + phone);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
}
var r = http.get(dm_api + "getPhone&sid=" + Project_ID + "&token=" + LoginToken + "&locationMatching=include&locationLevel=p&location=" + Provinces + "&showExtra=1&phoneType=" + PhoneType + "&vno=" + vno);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
case "短租":
if (phone != null) {
var r = http.get(dz_api + "getMobilenum&pid=" + Project_ID + "&uid=" + Account_Api + "&token=" + LoginToken + "&mobile=" + phone);
phone = r.body.string();
if (phone.indexOf(LoginToken) == -1) {
toastLog("获取号码失败,请检查账户信息及项目ID!");
return -1;
}
phone = phone.split("|");
return phone[0];
}
var r = http.get(dz_api + "getMobilenum&pid=" + Project_ID + "&uid=" + Account_Api + "&token=" + LoginToken + "&mobile=&size=1&province=" + Provinces + "&showExtra=1&operator=" + PhoneType + "&vno=" + vno);
phone = r.body.string();
if (phone.indexOf(LoginToken) == -1) {
toastLog("获取号码失败,请检查账户信息及项目ID!");
return -1;
}
phone = phone.split("|");
return phone[0];
case "易码":
if (phone != null) {
var r = http.get(ym_api + "getmobile&token=" + LoginToken + "&itemid=" + Project_ID + "&mobile" + phone);
phone = r.body.string();
if (phone.indexOf("success") == -1) {
toastLog("获取号码失败,请检查账户信息及项目ID!");
return -1;
}
phone = phone.split("|");
return phone[1];
}
var r = http.get(ym_api + "getmobile&token=" + LoginToken + "&itemid=" + Project_ID + "&excludeno=" + excludeno + "&province=" + ProvincesCode + "&isp=" + isp);
phone = r.body.string();
if (phone.indexOf("success") == -1) {
toastLog("获取号码失败,请检查账户信息及项目ID!");
return -1;
}
phone = phone.split("|");
return phone[1];
case "吸码皇":
// http://www.ximahuang.com/alz/api?action=getPhone&sid=项目id&token=登录时返回的令牌
if (phone != null) {
var r = http.get(xmh_api + "getPhone&sid=" + Project_ID + "&token=" + LoginToken + "&phone=" + phone);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
}
var r = http.get(xmh_api + "getPhone&sid=" + Project_ID + "&token=" + LoginToken + "&location=" + Provinces + "&phoneType=" + PhoneType + "&filterPrefix=" + filterPrefix);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
case "芒果云":
// http://www.mangopt.com:9000/doApi/getPhone?sid=项目id&token=登录时返回的令牌
if (phone != null) {
var r = http.get(mgy_api + "getPhone?sid=" + Project_ID + "&token=" + LoginToken + "&phone=" + phone);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
}
var r = http.get(mgy_api + "getPhone?sid=" + Project_ID + "&token=" + LoginToken + "&location=" + Provinces + "&phoneType=" + PhoneType + "&vno=" + vno);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
case "樱桃云":
// http://www.mangopt.com:9000/doApi/getPhone?sid=项目id&token=登录时返回的令牌
if (phone != null) {
var r = http.get(yty_api + "getPhone?sid=" + Project_ID + "&token=" + LoginToken + "&phone=" + phone);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
}
var r = http.get(yty_api + "getPhone?sid=" + Project_ID + "&token=" + LoginToken + "&location=" + Provinces + "&phoneType=" + PhoneType + "&vno=" + vno);
phone = r.body.string().split("|");
if (phone[0] == 0) {
toastLog(phone[1]);
return -1;
}
return phone[1];
case "TheWolf":
var r = http.get(TheWolf_api + "clients/online/setWork?token=" + LoginToken + "&pid=" + Project_ID + "&t=1&ascription=1");
r = r.body.json();
if (r.errno == 0) {
return r.ret.number;
} else {
toastLog(r.errmsg);
return -1;
}
default:
toast("未接入该接码平台!");
}
}
//获取验证码函数
function GetCode(phone, setOverTime, pat) {
if (setOverTime == null) {
var setOverTime = 60;
}
if (pat == null) {
var pat = /\d+/g;
}
switch (CodePlatform) {
case "共享":
var tag = 0;
var k = 0;
while (tag == 0 && k < Math.ceil(setOverTime / 3)) {
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
var r = http.get(gx_api + "getMessage&phone=" + phone + "&sid=" + Project_ID + "&token=" + LoginToken);
var code = r.body.string().split("|");
tag = code[0];
code = code[1];
k = k + 1;
}
if (tag == 0) {
toastLog("获取验证码超时或失败!");
return -1;
}
code = code.match(pat);
return code[0];
case "火云":
var tag = 0;
var k = 0;
while (tag == 0 && k < Math.ceil(setOverTime / 3)) {
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
var r = http.get(hy_api + "getMessage&phone=" + phone + "&sid=" + Project_ID + "&token=" + LoginToken);
var code = r.body.string().split("|");
tag = code[0];
code = code[1];
k = k + 1;
}
if (tag == 0) {
toastLog("获取验证码超时或失败!");
return -1;
}
code = code.match(pat);
return code[0];
case "多米":
var tag = 0;
var k = 0;
while (tag == 0 && k < Math.ceil(setOverTime / 3)) {
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
var r = http.get(dm_api + "getMessage&phone=" + phone + "&sid=" + Project_ID + "&token=" + LoginToken);
var code = r.body.string().split("|");
tag = code[0];
code = code[1];
k = k + 1;
}
if (tag == 0) {
toastLog("获取验证码超时或失败!");
return -1;
}
code = code.match(pat);
return code[0];
case "短租":
var tag = 0;
var k = 0;
while (tag != phone && k < Math.ceil(setOverTime / 3)) {
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
var r = http.get(dz_api + "getVcodeAndReleaseMobile&uid=" + Account_Api + "&token=" + LoginToken + "&mobile=" + phone);
var code = r.body.string().split("|");
tag = code[0];
code = code[1];
k = k + 1;
}
if (tag != phone) {
toastLog("获取验证码超时或失败!");
return -1;
}
code = code.match(pat);
return code[0];
case "易码":
var tag = 0;
var i = 0;
while (tag != "success" && i < Math.ceil(setOverTime / 3)) {
var r = http.get(ym_api + "getsms&token=" + LoginToken + "&itemid=" + Project_ID + "&mobile=" + phone);
var code = r.body.string().split("|");
tag = code[0];
code = code[1];
i = i + 1;
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
}
if (tag != "success") {
toastLog("获取验证码超时或失败!");
return -1;
}
code = code.match(pat);
return code[0];
case "吸码皇":
// http://www.ximahuang.com/alz/api?action=getMessage&sid=项目id&phone=取出来的手机号&token=登录时返回的令牌
var tag = 0;
var k = 0;
while (tag == 0 && k < Math.ceil(setOverTime / 3)) {
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
var r = http.get(xmh_api + "getMessage&phone=" + phone + "&sid=" + Project_ID + "&token=" + LoginToken);
var code = r.body.string().split("|");
tag = code[0];
code = code[1];
k = k + 1;
}
if (tag == 0) {
toastLog("获取验证码超时或失败!");
return -1;
}
code = code.match(pat);
return code[0];
case "芒果云":
// http://www.mangopt.com:9000/doApi/getMessage?sid=项目id&phone=取出来的手机号&token=登录时返回的令牌
var tag = 0;
var k = 0;
while (tag == 0 && k < Math.ceil(setOverTime / 3)) {
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
var r = http.get(mgy_api + "getMessage?phone=" + phone + "&sid=" + Project_ID + "&token=" + LoginToken);
var code = r.body.string().split("|");
tag = code[0];
code = code[1];
k = k + 1;
}
if (tag == 0) {
toastLog("获取验证码超时或失败!");
return -1;
}
code = code.match(pat);
return code[0];
case "樱桃云":
// http://www.mangopt.com:9000/doApi/getMessage?sid=项目id&phone=取出来的手机号&token=登录时返回的令牌
var tag = 0;
var k = 0;
while (tag == 0 && k < Math.ceil(setOverTime / 3)) {
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
var r = http.get(yty_api + "getMessage?phone=" + phone + "&sid=" + Project_ID + "&token=" + LoginToken);
var code = r.body.string().split("|");
tag = code[0];
code = code[1];
k = k + 1;
}
if (tag == 0) {
toastLog("获取验证码超时或失败!");
return -1;
}
code = code.match(pat);
return code[0];
case "TheWolf":
var tag;
var k = 0;
while (tag != 0 && k < Math.ceil(setOverTime / 3)) {
toastLog("未获取到短信,等待3秒重试!");
sleep(3000);
var r = http.get(TheWolf_api + "clients/sms/getSms?token=" + LoginToken + "&project=" + Project_ID + "&number=" + phone + "&type=1");
r = r.body.json();
tag = r.errno;
k = k + 1;
}
if (tag == 0) {
var code = r.ret.tst;
log(code);
code = code.match(pat);
return code;
}
return -1;
default:
toast("未接入该接码平台!");
}
}
//释放手机号函数
function rec(phone) {
switch (接码平台) {
case "共享":
var r = http.get(gx_api + "cancelRecv&phone=" + phone + "&sid=" + Project_ID + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "火云":
var r = http.get(hy_api + "cancelRecv&sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "多米":
var r = http.get(dm_api + "cancelRecv&sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "短租":
var r = http.get(dz_api + "addIgnoreList&uid=" + Account_Api + "&token=" + LoginToken + "&mobiles=" + phone + "&pid=" + Project_ID);
var sfphone = r.body.string();
if (sfphone == 1) {
return 0;
} else {
return -1;
}
case "易码":
var r = http.get(ym_api + "release&token=" + LoginToken + "&itemid=" + Project_ID + "&mobile=" + phone);
var sfphone = r.body.string();
if (sfphone == "success") {
return 0;
} else {
return -1;
}
case "吸码皇":
// http://www.ximahuang.com/alz/api?action=cancelRecv&sid=项目id&phone=要释放的手机号&token=登录时返回的令牌
var r = http.get(xmh_api + "cancelRecv&sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "芒果云":
// http://www.mangopt.com:9000/doApi/cancelRecv?sid=项目id&phone=要释放的手机号&token=登录时返回的令牌
var r = http.get(mgy_api + "cancelRecv?sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "樱桃云":
// http://www.mangopt.com:9000/doApi/cancelRecv?sid=项目id&phone=要释放的手机号&token=登录时返回的令牌
var r = http.get(yty_api + "cancelRecv?sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "TheWolf":
var r = http.get(TheWolf_api + "clients/online/completeWork?token=" + LoginToken + "&phone=" + phone);
var r = r.body.json();
var errno = r.errno;
if (errno > 0) {
return -1;
} else if (errno == 0) {
return 0;
}
default:
toast("未接入该接码平台!");
}
}
//加黑手机号函数
function addBlacklist(phone) {
switch (接码平台) {
case "共享":
var r = http.get(gx_api + "addBlacklist&sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "火云":
var r = http.get(hy_api + "addBlacklist&sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "多米":
var r = http.get(dm_api + "addBlacklist&sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "短租":
var r = http.get(dz_api + "addIgnoreList&uid=" + Account_Api + "&token=" + LoginToken + "&mobiles=" + phone + "&pid=" + Project_ID);
var sfphone = r.body.string();
if (sfphone == 1) {
return 0;
} else {
return -1;
}
case "易码":
var r = http.get(ym_api + "addignore&token=" + LoginToken + "&itemid=" + Project_ID + "&mobile=" + phone);
var sfphone = r.body.string();
if (sfphone == "success") {
return 0;
} else {
return -1;
}
case "吸码皇":
// http://www.ximahuang.com/alz/api?action=addBlacklist&sid=项目id&phone=要加入黑名单的手机号&token=登录时返回的令牌
var r = http.get(xmh_api + "addBlacklist&sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "芒果云":
// http://www.cherryun.com:8000/doApi/addBlacklist?sid=项目id&phone=要加入黑名单的手机号&token=登录时返回的令牌
var r = http.get(mgy_api + "addBlacklist?sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
case "樱桃云":
// http://www.cherryun.com:8000/doApi/addBlacklist?sid=项目id&phone=要加入黑名单的手机号&token=登录时返回的令牌
var r = http.get(yty_api + "addBlacklist?sid=" + Project_ID + "&phone=" + phone + "&token=" + LoginToken);
var sfphone = r.body.string().split("|");
if (sfphone[0] == 1) {
return 0;
} else {
return -1;
}
default:
toast("未接入该接码平台!");
}
}
//讯代理优质
/*
** var 讯代理spiderId = "e1646d4003b34271a70a5bebc4abe56a";
** var 优质代理订单号 = "YZ20188168670Q4k4pr";
** xdaili_youzhi(讯代理spiderId,优质代理订单号);
*/
function xdaili_youzhi(spiderId, orderNo) {
var spId = spiderId; //spiderId
var odNo = orderNo; //订单号
var getIp_api = http.get('http://pv.sohu.com/cityjson?ie=utf-8');
var InetIP = getIp_api.body.string();
eval(InetIP);
log("代理前外网IP:" + returnCitySN.cip);
var xdailiUrl = "http://api.xdaili.cn/xdaili-api//greatRecharge/getGreatIp?spiderId=" + spId + "&orderno=" + odNo + "&returnType=2&count=1";
for (let i = 0; i < 3; i++) {
try {
var getProxy_json = http.get(xdailiUrl).body.json();
if (getProxy_json.ERRORCODE == "10036" || getProxy_json.ERRORCODE == "10038" || getProxy_json.ERRORCODE == "10055") {
throw {
"code": "-1",
"msg": "提取速度过快"
}
}
if (getProxy_json.ERRORCODE == "10036") {
throw {
"code": "-2",
"msg": "提取次数已达上限"
}
}
if (getProxy_json.ERRORCODE == "10063") {
throw {
"code": "-3",
"msg": "请输入正确的spiderId!"
}
}
if (getProxy_json.ERRORCODE == "10073") {
throw {
"code": "-4",
"msg": "订单不存在!"
}
}
break;
} catch (e) {
if (e.code == "-1") {
log(e.msg);
sleep(5000);
}
if (e.code == "-2") {
log(e.msg);
exit();
}
if (e.code == "-3") {
log(e.msg);
exit();
}
if (e.code == "-4") {
log(e.msg);
exit();
}
if (i == 2) { //运行3次后,没有拿到IP和端口 程序结束
log("发生了未知错误,请检查网络...");
exit();
}
}
}
var xdaili_proxyIP = getProxy_json.RESULT[0].ip;
var xdaili_proxyPort = parseInt(getProxy_json.RESULT[0].port);
httpProxy(xdaili_proxyIP, xdaili_proxyPort);
var getIp_api = http.get('http://pv.sohu.com/cityjson?ie=utf-8');
var InetIP = getIp_api.body.string();
eval(InetIP);
log("代理后外网IP:" + returnCitySN.cip);
}
function httpProxy(url, prot) {
var Proxy = java.net.Proxy;
var InetSocketAddress = java.net.InetSocketAddress;
var okhttp = new Packages.okhttp3.OkHttpClient.Builder().proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(url, prot)));
http.__okhttp__.muteClient(okhttp);
}
function lianzhong(e, t, a) {
http.__okhttp__.setTimeout(3e4);
var o = images.load(a),
r = images.toBase64(o, format = "png"),
i = device.release,
c = device.model,
s = device.buildId;
try {
var n = http.postJson("https://v2-api.jsdama.com/upload", {
softwareId: 11899,
softwareSecret: "Jyyh42S6ntMYzVK4msI1xQDpq2YJM7gMo0OtfoYp",
username: e,
password: t,
captchaData: r,
captchaType: 1001,
captchaMinLength: 0,
captchaMaxLength: 0,
workerTipsId: 0
}, {
headers: {
Host: "v2-api.jsdama.com",
Connection: "keep-alive",
"Content-Length": "298",
Accept: "application/json, text/javascript, */*; q=0.01",
"User-Agent": "Mozilla/5.0 (Linux; Android " + i + "; " + c + " Build/" + s + "; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 Mobile Safari/537.36",
"Content-Type": "text/json"
}
});
} catch (e) {
return {
code: "-1",
msg: "网络链接超时...",
data: {}
};
}
var d = n.body.json(),
p = d.code,
m = d.message;
if ("10079009" == p) return {
code: p,
msg: m,
data: {}
};
if ("10142006" == p) return {
code: p,
msg: m,
data: {}
};
if ("10142004" == p) return {
code: p,
msg: m,
data: {}
};
if ("10142005" == p) return {
code: p,
msg: m,
data: {}
};
if ("10079006" == p) return {
code: p,
msg: m,
data: {}
};
if ("0" == p) {
return {
code: p,
msg: m,
data: {
res: d.data.recognition
}
};
}
return d;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。