修正爱奇艺签到

qyid可以用cookie的QC005  也可以随机生成   随机生成增加一个模块string-random
Cookie增加一个P00003的值  作者修改下getcookie相关即可
This commit is contained in:
BlueSkyClouds 2022-01-24 15:56:04 +08:00 committed by GitHub
parent 7e417ea75d
commit b1b49e530a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 84 additions and 18 deletions

View File

@ -1,7 +1,7 @@
/*
爱奇艺会员签到脚本
更新时间: 2021.9.22
更新时间: 2022.1.24
脚本兼容: QuantumultX, Surge4, Loon, JsBox, Node.js
电报频道: @NobyDa
问题反馈: @NobyDa_bot
@ -14,7 +14,7 @@
如果使用Node.js, 需自行安装'request'模块. : npm install request -g
JsBox, Node.js用户抓取Cookie说明
开启抓包, 打开爱奇艺App后(AppStore中国区)点击"我的" 返回抓包App 搜索请求头关键字 psp_cki= P00001= authcookie=
开启抓包, 打开爱奇艺App后(AppStore中国区)点击"我的" 返回抓包App 搜索请求头关键字 psp_cki= P00001= authcookie= P00003=
提取字母数字混合字段, &结束, 填入以下单引号内即可.
*/
@ -76,12 +76,18 @@ var $nobyda = nobyda();
if ($nobyda.isRequest) {
GetCookie()
} else if (cookie) {
await login();
await Checkin();
await Lottery(500);
await $nobyda.time();
} else {
$nobyda.notify("爱奇艺会员", "", "签到终止, 未获取Cookie");
if (cookie.includes("P00001") && cookie.includes("P00003")) {
var P00001 = cookie.match(/P00001=(.*?);/)[1];
var P00003 = cookie.match(/P00003=(.*?);/)[1];
}
if (P00001 !== "" && P00003 !== "" && dfp !== ""){
await login();
await Checkin();
await Lottery(500);
await $nobyda.time();
}else{
$nobyda.notify("爱奇艺会员", "", "签到终止, 未获取Cookie");
}
}
})().finally(() => {
$nobyda.done();
@ -111,26 +117,57 @@ function login() {
}
function Checkin() {
const timestamp = new Date().getTime();
const stringRandom = require('string-random');
return new Promise(resolve => {
const sign_date = {
agentType: "1",
agentversion: "1.0",
appKey: "basic_pcw",
authCookie: P00001,
qyid: md5(stringRandom(16)),
task_code: "natural_month_sign",
timestamp: timestamp,
typeCode: "point",
userId: P00003,
};
const post_date = {
"natural_month_sign": {
"agentType": "1",
"agentversion": "1",
"authCookie": P00001,
"qyid": md5(stringRandom(16)),
"taskCode": "iQIYI_mofhr",
"verticalCode": "iQIYI"
}
};
const sign = k("UKobMjDMsDoScuWOfp6F", sign_date, {
split: "|",
sort: !0,
splitSecretKey: !0
});
var URL = {
url: 'https://tc.vip.iqiyi.com/taskCenter/task/queryUserTask?autoSign=yes&P00001=' + cookie
url: 'https://community.iqiyi.com/openApi/task/execute?' + w(sign_date) + "&sign=" + sign,
headers: {
'Content-Type':'application/json'
},
body: JSON.stringify(post_date)
}
$nobyda.get(URL, function(error, response, data) {
$nobyda.post(URL, function(error, response, data) {
if (error) {
$nobyda.data = "签到失败: 接口请求出错 ‼️"
console.log(`爱奇艺-${$nobyda.data} ${error}`)
} else {
const obj = JSON.parse(data)
const Details = LogDetails ? `response:\n${data}` : ''
if (obj.msg == "成功") {
if (obj.data.signInfo.code == "A00000") {
var AwardName = obj.data.signInfo.data.rewards[0].name;
var quantity = obj.data.signInfo.data.rewards[0].value;
var continued = obj.data.signInfo.data.cumulateSignDaysSum;
$nobyda.data = "签到成功: " + AwardName + quantity + ", 累计签到" + continued + "天 🎉"
if (obj.code === "A00000") {
if (obj.data.code === "A0000") {
var quantity = obj.data.data.rewards[0].rewardCount;
var continued = obj.data.data.signDays;
$nobyda.data = "签到成功: 获得积分" + quantity + ", 累计签到" + continued + "天 🎉"
console.log(`爱奇艺-${$nobyda.data} ${Details}`)
} else {
$nobyda.data = "签到失败: " + obj.data.signInfo.msg + " ⚠️"
$nobyda.data = "签到失败: " + obj.data.msg + " ⚠️"
console.log(`爱奇艺-${$nobyda.data} ${Details}`)
}
} else {
@ -352,4 +389,33 @@ function nobyda() {
times,
done
}
};
};
function k(e, t) {
var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
, n = a.split
, c = void 0 === n ? "|" : n
, r = a.sort
, s = void 0 === r || r
, o = a.splitSecretKey
, i = void 0 !== o && o
, l = s ? Object.keys(t).sort() : Object.keys(t)
, u = l.map((function (e) {
return "".concat(e, "=").concat(t[e])
}
)).join(c) + (i ? c : "") + e;
return md5(u)
}
function md5(date){
const crypto = require('crypto');
return crypto.createHash("md5").update(date, "utf8").digest("hex")
}
function w(){
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
, t = [];
return Object.keys(e).forEach((function (a) {
t.push("".concat(a, "=").concat(e[a]))
}
)),
t.join("&")
}