updated 52pojie and iQiyi checkin scripts adapted to QX or surge

This commit is contained in:
humingxNobyDaconfig --global user.email 53217160+NobyDa@users.noreply.github.comssh-keygen -t rsa -C humingx@yeah.nethumingx@yeah.net 2019-12-29 16:31:23 +08:00
parent ffb419d5a6
commit 3e88d728a3
6 changed files with 270 additions and 16 deletions

View File

@ -0,0 +1,54 @@
/*
52pojie forum daily bonus script
Update 2019.12.29 15:30
About the author:
If reproduced, indicate the source
Telegram channel: @NobyDa
Telegram bots: @NobyDa_bot
Description :
Need to manually log in to the https://www.52pojie.cn/home.php?mod=space checkin to get cookie. if QX pops up to get a cookie success notification, you can disable this script.
Note that the following config is only a local script configuration, please put this script into Quantumult X/Script
script will be performed every day at 9 am. You can modify the execution time.
[task_local]
# 52pojie daily bonus script
0 9 * * * 52pojie_DailyBonus_QX.js
[rewrite_local]
# Get Cookie
https:\/\/www\.52pojie\.cn\/home\.php\?mod=space url script-response-body 52pojie_GetCookie_QX.js
# MITM = www.52pojie.cn
*/
var bonus = {
url: 'https://www.52pojie.cn/home.php?mod=task&do=apply&id=2&mobile=no',
headers: {
"Cookie": $prefs.valueForKey("CookieWA"),
}
};
var date = new Date()
var week = ["Sunday","Monday","Tuseday","Wednesday","Thursday","Friday","Saturday"];
var month = ["Jan.","Feb.","Mar.","Apr.","May","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."];
$task.fetch(bonus).then(response => {
if (response.body.match(/\u606d\u559c\u60a8/)) {
$notify("52pojie Daily bonus", "", week[date.getDay()] + ", " + month[date.getMonth()] + " " + date.getDate() + ", " + "Daily bonus success🎉")
} else {
if (response.body.match(/\u4e0b\u671f\u518d\u6765/)) {
$notify("52pojie Daily bonus", "", week[date.getDay()] + ", " + month[date.getMonth()] + " " + date.getDate() + ", " + "Repeat ⚠️")
} else {
if (response.body.match(/\u9700\u8981\u5148\u767b\u5f55/)) {
$notify("52pojie Daily bonus. Error. Cookies expire", "", "Please reopen the script to get‼")
} else {
$notify("52pojie Daily bonus", "", "Scripts need to be updated ‼️‼️")
}
}
}
}, reason => {
$notify("52pojie Daily bonus. Interface error‼", "", reason.error)
});

View File

@ -0,0 +1,49 @@
/*
52pojie forum daily bonus script
Update 2019.12.29 15:30
About the author:
If reproduced, indicate the source
Telegram channel: @NobyDa
Telegram bots: @NobyDa_bot
Description :
Need to manually log in to the https://www.52pojie.cn/home.php?mod=space checkin to get cookie. if QX pops up to get a cookie success notification, you can disable this script.
Note that the following config is only a local script configuration, please put this script into Quantumult X/Script
script will be performed every day at 9 am. You can modify the execution time.
[task_local]
# 52pojie daily bonus script
0 9 * * * 52pojie_DailyBonus_QX.js
[rewrite_local]
# Get Cookie
https:\/\/www\.52pojie\.cn\/home\.php\?mod=space url script-response-body 52pojie_GetCookie_QX.js
# MITM = www.52pojie.cn
*/
var WAPJ = $request.headers["Cookie"];
if (WAPJ) {
if ($prefs.valueForKey("CookieWA") != undefined) {
if ($prefs.valueForKey("CookieWA") != WAPJ) {
var cookie = $prefs.setValueForKey(WAPJ, "CookieQY");
if (!cookie) {
$notify("更新吾爱破解签到Cookie失败‼", "", "")
} else {
$notify("更新吾爱破解签到Cookie成功 🎉", "", "")
}
}
} else {
var cookie = $prefs.setValueForKey(WAPJ, "CookieWA");
if (!cookie) {
$notify("首次写入吾爱破解Cookie失败‼", "", "")
} else {
$notify("首次写入吾爱破解Cookie成功 🎉", "", "")
}
}
}
$done({})

View File

@ -21,6 +21,7 @@ https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login url script-response-body TieBa_GetC
*/
var cookieVal = $prefs.valueForKey("CookieTB");
var useParallel = 0; //0自动切换,1串行,2并行(当贴吧数量大于30个以后,并行可能会导致QX崩溃,所以您可以自动切换)
var singleNotifyCount = 20; //想签到几个汇总到一个通知里,这里就填几个(比如我有13个要签到的,这里填了5,就会分三次消息通知过去)
var process = {
total: 0,
@ -69,8 +70,12 @@ function signTieBa() {
}
process.total = body.data.like_forum.length;
if (body.data.like_forum && body.data.like_forum.length > 0) {
if (useParallel == 1 || (useParallel == 0 && body.data.like_forum.length >= 30)) {
signBars(body.data.like_forum, body.data.tbs, 0);
} else {
for (const bar of body.data.like_forum) {
signBar(bar, body.data.tbs);
signBar(bar, body.data.tbs);
}
}
} else {
$notify("贴吧签到", "签到失败", "请确认您有关注的贴吧");
@ -94,22 +99,22 @@ function signBar(bar, tbs) {
} else {
url_fetch_add.body = `tbs=${tbs}&kw=${bar.forum_name}&ie=utf-8`;
$task.fetch(url_fetch_add).then(response => {
try{
try {
var addResult = JSON.parse(response.body);
if (addResult.no == 0) {
process.result.push({
bar: bar.forum_name,
errorCode: 0,
errorMsg: `获得${addResult.data.uinfo.cont_sign_num}积分,第${addResult.data.uinfo.user_sign_rank}个签到`
});
} else {
process.result.push({
bar: bar.forum_name,
errorCode: addResult.no,
errorMsg: addResult.error
});
}
}catch(e){
if (addResult.no == 0) {
process.result.push({
bar: bar.forum_name,
errorCode: 0,
errorMsg: `获得${addResult.data.uinfo.cont_sign_num}积分,第${addResult.data.uinfo.user_sign_rank}个签到`
});
} else {
process.result.push({
bar: bar.forum_name,
errorCode: addResult.no,
errorMsg: addResult.error
});
}
} catch (e) {
$notify("贴吧签到", "贴吧签到数据处理异常", JSON.stringify(e));
}
checkIsAllProcessed();
@ -124,7 +129,58 @@ function signBar(bar, tbs) {
}
}
function signBars(bars, tbs, index) {
//$notify("贴吧签到", `进度${index}/${bars.length}`, "");
if (index >= bars.length) {
//$notify("贴吧签到", "签到已满", `${process.result.length}`);
checkIsAllProcessed();
} else {
var bar = bars[index];
if (bar.is_sign == 1) { //已签到的,直接不请求接口了
process.result.push({
bar: `${bar.forum_name}`,
level: bar.user_level,
exp: bar.user_exp,
errorCode: 9999,
errorMsg: "已签到"
});
signBars(bars, tbs, ++index);
} else {
url_fetch_add.body = `tbs=${tbs}&kw=${bar.forum_name}&ie=utf-8`;
$task.fetch(url_fetch_add).then(response => {
try {
var addResult = JSON.parse(response.body);
if (addResult.no == 0) {
process.result.push({
bar: bar.forum_name,
errorCode: 0,
errorMsg: `获得${addResult.data.uinfo.cont_sign_num}积分,第${addResult.data.uinfo.user_sign_rank}个签到`
});
} else {
process.result.push({
bar: bar.forum_name,
errorCode: addResult.no,
errorMsg: addResult.error
});
}
} catch (e) {
$notify("贴吧签到", "贴吧签到数据处理异常", JSON.stringify(e));
}
signBars(bars, tbs, ++index)
}, reason => {
process.result.push({
bar: bar.forum_name,
errorCode: 999,
errorMsg: '接口错误'
});
signBars(bars, tbs, ++index);
});
}
}
}
function checkIsAllProcessed() {
//$notify("贴吧签到", `最终进度${process.result.length}/${process.total}`, "");
if (process.result.length != process.total) return;
for (var i = 0; i < Math.ceil(process.total / singleNotifyCount); i++) {
var notify = "";

View File

@ -1,6 +1,9 @@
/*
52pojie Forum get cookie
Description :
Need to manually log in to the https://www.52pojie.cn/home.php?mod=space checkin to get cookie. If you receive a cookie success notification, you can disable this script.
Surge 4.0 : [Script]
http-request https:\/\/www\.52pojie\.cn\/home\.php\? script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/52pojieDailyBonus/Get-Cookie.js

View File

@ -0,0 +1,46 @@
/*
iQIYI Daily bonus script
Update 2019.12.29 15:30
About the author:
If reproduced, indicate the source
Telegram channel: @NobyDa
Telegram bots: @NobyDa_bot
Description :
When iQiyi app is opened, click "My", If notification gets cookie success, you can use the check in script. because script will automatically judgment whether the cookie is updated, so you dont need to disable it manually.
script will be performed every day at 9 am. You can modify the execution time. and the cookie script only works for iQIYI apps in china apple store
[Script]
# iQIYI Daily bonus script
cron "0 8 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/iQIYI-DailyBonus/iQIYI_DailyBonus.js
# Get Cookie
http-request https:\/\/passport\.iqiyi\.com\/apis\/user\/info\.action.*authcookie script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/iQIYI-DailyBonus/iQIYI_GetCookie.js
# MITM = passport.iqiyi.com
*/
$httpClient.get('https://tc.vip.iqiyi.com/taskCenter/task/queryUserTask?autoSign=yes&P00001=' + $persistentStore.read("CookieQY"), function(error, response, data) {
if (error) {
$notification.post("爱奇艺签到,请求失败‼️‼️‼", "", error);
} else {
var obj = JSON.parse(data);
if (obj.msg == "成功") {
if (obj.data.signInfo.code == "A00000") {
console.log("success response: \n" + data);
var status = obj.data.signInfo.msg;
var award = obj.data.signInfo.data.acquireGiftList[0];
var continued = obj.data.signInfo.data.continueSignDaysSum;
$notification.post("爱奇艺签到", "", status + "!获得" + award + ", 已连续签到" + continued + "天 🎉");
} else {
console.log("failure response: \n" + data);
$notification.post("爱奇艺签到", "", "失败, " + obj.data.signInfo.msg + "⚠️");
}
} else {
$notification.post("爱奇艺签到,Cookie无效‼", "", data);
}
}
})

View File

@ -0,0 +1,46 @@
/*
iQIYI Daily bonus script
Update 2019.12.29 15:30
About the author:
If reproduced, indicate the source
Telegram channel: @NobyDa
Telegram bots: @NobyDa_bot
Description :
When iQiyi app is opened, click "My", If notification gets cookie success, you can use the check in script. because script will automatically judgment whether the cookie is updated, so you dont need to disable it manually.
script will be performed every day at 9 am. You can modify the execution time. and the cookie script only works for iQIYI apps in china apple store
[Script]
# iQIYI Daily bonus script
cron "0 8 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/iQIYI-DailyBonus/iQIYI_DailyBonus.js
# Get Cookie
http-request https:\/\/passport\.iqiyi\.com\/apis\/user\/info\.action.*authcookie script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/iQIYI-DailyBonus/iQIYI_GetCookie.js
# MITM = passport.iqiyi.com
*/
var regex = /authcookie=([A-Za-z0-9]+)/;
var iQIYI = regex.exec($request.url)[1];
if ($persistentStore.read("CookieQY") != null) {
if ($persistentStore.read("CookieQY") != iQIYI) {
var cookie = $persistentStore.write(iQIYI, "CookieQY");
if (!cookie) {
$notification.post("更新爱奇艺签到Cookie失败‼", "", "")
} else {
$notification.post("更新爱奇艺签到Cookie成功 🎉", "", "")
}
}
} else {
var cookie = $persistentStore.write(iQIYI, "CookieQY");
if (!cookie) {
$notification.post("首次写入爱奇艺Cookie失败‼", "", "")
} else {
$notification.post("首次写入爱奇艺Cookie成功 🎉", "", "")
}
}
$done({})