京东: 添加生鲜接口 #115

This commit is contained in:
humingxNobyDaconfig --global user.email 53217160+NobyDa@users.noreply.github.comssh-keygen -t rsa -C humingx@yeah.nethumingx@yeah.net 2020-05-10 21:20:10 +08:00
parent 2a436150c3
commit eb054519da
1 changed files with 72 additions and 3 deletions

View File

@ -2,7 +2,7 @@
京东多合一签到脚本
更新时间: 2020.5.3 3:00 v1.00
更新时间: 2020.5.10 21:10 v1.01
有效接口: 22+
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
电报频道: @NobyDa
@ -95,11 +95,12 @@ async function all() {
JingDongClocks(stop), //京东钟表馆
JingDongPet(stop), //京东宠物馆
JDFlashSale(stop), //京东闪购
JDRawFresh(stop), //京东生鲜
JingDongBook(stop), //京东图书
JDSecondhand(stop), //京东拍拍二手
JingDMakeup(stop), //京东美妆馆
JingDongWomen(stop), //京东女装馆
JingDongFish(stop), //京东小京鱼
//JingDongFish(stop), //京东小京鱼
JingDongCash(stop), //京东现金红包
//JingDongShoes(stop), //京东鞋靴馆
JingDongFood(stop), //京东美食馆
@ -121,6 +122,7 @@ async function all() {
await JingDongShake(stop); //京东摇一摇
await JingDongPrize(stop); //京东抽大奖
await JDFlashSale(stop); //京东闪购
await JDRawFresh(stop); //京东生鲜
await JDGroceryStore(stop); //京东超市
await JingDongClocks(stop); //京东钟表馆
await JingDongPet(stop); //京东宠物馆
@ -128,7 +130,7 @@ async function all() {
await JDSecondhand(stop); //京东拍拍二手
await JingDMakeup(stop); //京东美妆馆
await JingDongWomen(stop); //京东女装馆
await JingDongFish(stop); //京东小京鱼
//await JingDongFish(stop); //京东小京鱼
await JDMagicCube(stop); //京东小魔方
await JingDongCash(stop); //京东现金红包
await JingDongJewels(stop); //京东珠宝馆
@ -2172,6 +2174,72 @@ function JingDongJewels(s) {
});
}
function JDRawFresh(s) {
return new Promise(resolve => {
setTimeout(() => {
const FreshUrl = {
url: 'https://api.m.jd.com/client.action?functionId=userSign',
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Cookie: KEY,
},
body: "body=%7B%22params%22%3A%22%7B%5C%22enActK%5C%22%3A%5C%22hxDQlh9sKWg4cXt%2B8jAzLGw1gCEzpKZCtT0JUj%2FMKdgaZs%2Fn4coLNw%3D%3D%5C%22%2C%5C%22isFloatLayer%5C%22%3Afalse%2C%5C%22ruleSrv%5C%22%3A%5C%22%5C%22%2C%5C%22signId%5C%22%3A%5C%22PhxqYqd4RYcaZs%2Fn4coLNw%3D%3D%5C%22%7D%22%2C%22riskParam%22%3A%7B%22platform%22%3A%223%22%2C%22orgType%22%3A%222%22%2C%22openId%22%3A%22-1%22%2C%22pageClickKey%22%3A%22Babel_Sign%22%2C%22eid%22%3A%22%22%2C%22fp%22%3A%22%22%2C%22shshshfp%22%3A%22%22%2C%22shshshfpa%22%3A%22%22%2C%22shshshfpb%22%3A%22%22%2C%22childActivityUrl%22%3A%22%22%7D%2C%22mitemAddrId%22%3A%22%22%2C%22geo%22%3A%7B%22lng%22%3A%22%22%2C%22lat%22%3A%22%22%7D%2C%22addressId%22%3A%22%22%2C%22posLng%22%3A%22%22%2C%22posLat%22%3A%22%22%2C%22focus%22%3A%22%22%2C%22innerAnchor%22%3A%22%22%2C%22cv%22%3A%222.0%22%7D&client=wh5"
};
$nobyda.post(FreshUrl, function(error, response, data) {
try {
if (error) {
merge.JDFresh.notify = "京东商城-生鲜: 签到接口请求失败 ‼️‼️"
merge.JDFresh.fail = 1
} else {
const cc = JSON.parse(data)
if (data.match(/签到成功/)) {
var Details = LogDetails ? "response:\n" + data : '';
console.log("\n" + "京东商城-生鲜签到成功 " + Details)
if (data.match(/(\"text\":\"\d+京豆\")/)) {
beanQuantity = cc.awardList[0].text.match(/\d+/)
merge.JDFresh.notify = "京东商城-生鲜: 成功, 明细: " + beanQuantity + "京豆 🐶"
merge.JDFresh.bean = beanQuantity
merge.JDFresh.success = 1
} else {
merge.JDFresh.notify = "京东商城-生鲜: 成功, 明细: 无京豆 🐶"
merge.JDFresh.success = 1
}
} else {
var Details = LogDetails ? "response:\n" + data : '';
console.log("\n" + "京东商城-生鲜签到失败 " + Details)
if (data.match(/(已签到|已领取)/)) {
merge.JDFresh.notify = "京东商城-生鲜: 失败, 原因: 已签过 ⚠️"
merge.JDFresh.fail = 1
} else {
if (data.match(/(不存在|已结束|未开始)/)) {
merge.JDFresh.notify = "京东商城-生鲜: 失败, 原因: 活动已结束 ⚠️"
merge.JDFresh.fail = 1
} else {
if (cc.code == 3) {
merge.JDFresh.notify = "京东商城-生鲜: 失败, 原因: Cookie失效‼"
merge.JDFresh.fail = 1
} else if (cc.code == "600") {
merge.JDFresh.notify = "京东商城-生鲜: 失败, 原因: 认证失败 ⚠️"
merge.JDFresh.fail = 1
} else {
merge.JDFresh.notify = "京东商城-生鲜: 失败, 原因: 未知 ⚠️"
merge.JDFresh.fail = 1
}
}
}
}
}
resolve()
} catch (eor) {
$nobyda.notify("京东商城-生鲜" + eor.name + "‼️", JSON.stringify(eor), eor.message)
resolve()
}
})
}, s)
if (out) setTimeout(resolve, out + s)
});
}
function TotalSteel() {
return new Promise(resolve => {
const SteelUrl = {
@ -2305,6 +2373,7 @@ function initial() {
JDFish: {},
JDFood: {},
JDClean: {},
JDFresh: {},
JDJewels: {},
JDCube: {},
JDPrize: {},