update path

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-12 15:44:00 +08:00
parent 578a006c09
commit e70cefe1f3
4 changed files with 534 additions and 9 deletions

View File

@ -0,0 +1,176 @@
/*
吾爱破解签到脚本
更新时间: 2020.5.12 11:00
脚本兼容: QuantumultX, Surge, Loon
电报频道: @NobyDa
问题反馈: @NobyDa_bot
说明
手动登录 https://www.52pojie.cn 如通知成功获取cookie, 则可以使用此签到脚本.
获取Cookie后, 请将Cookie脚本禁用并移除主机名以免产生不必要的MITM.
脚本将在每天上午9点执行 您可以修改执行时间
************************
Surge 4.2.0+ 脚本配置:
************************
[Script]
吾爱签到 = type=cron,cronexp=0 9 * * *,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/52pojie-DailyBonus/52pojie.js
吾爱获取Cookie = type=http-request,pattern=https:\/\/www\.52pojie\.cn\/home\.php\?,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/52pojie-DailyBonus/52pojie.js
[MITM]
hostname= www.52pojie.cn
************************
QuantumultX 本地脚本配置:
************************
[task_local]
# 吾爱签到
0 9 * * * 52pojie.js
[rewrite_local]
# 获取Cookie
https:\/\/www\.52pojie\.cn\/home\.php\? url script-request-header 52pojie.js
[mitm]
hostname= www.52pojie.cn
************************
Loon 2.1.0+ 脚本配置:
************************
[Script]
# 吾爱签到
cron "0 9 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/52pojie-DailyBonus/52pojie.js
# 获取Cookie
http-request https:\/\/www\.52pojie\.cn\/home\.php\? script-path=https://raw.githubusercontent.com/NobyDa/Script/master/52pojie-DailyBonus/52pojie.js
[Mitm]
hostname= www.52pojie.cn
*/
var $nobyda = nobyda();
var date = new Date()
if ($nobyda.isRequest) {
GetCookie()
} else {
checkin()
}
function checkin() {
var bonus = {
url: 'https://www.52pojie.cn/home.php?mod=task&do=apply&id=2&mobile=no',
headers: {
Cookie: $nobyda.read("CookieWA"),
}
};
$nobyda.get(bonus, function(error, response, data) {
if (error) {
console.log(error);
$nobyda.notify("吾爱破解", "签到请求失败 ‼️‼️", error)
} else {
if (data.match(/(ÒÑÍê³É|\u606d\u559c\u60a8)/)) {
$nobyda.notify("吾爱破解", "", date.getMonth() + "月" + date.getDate() + "日, 签到成功 🎉")
} else if (data.match(/(ÄúÒÑ|\u4e0b\u671f\u518d\u6765)/)) {
$nobyda.notify("吾爱破解", "", date.getMonth() + "月" + date.getDate() + "日, 已签过 ⚠️")
} else if (data.match(/(ÏȵǼ|\u9700\u8981\u5148\u767b\u5f55)/)) {
$nobyda.notify("吾爱破解", "", "签到失败, Cookie失效 ‼️‼️")
} else {
$nobyda.notify("吾爱破解", "", "脚本待更新 ‼️‼️")
}
}
$nobyda.done();
})
}
function GetCookie() {
try {
if ($request.headers && $request.url.match(/www\.52pojie\.cn/)) {
var CookieName = "吾爱破解";
var CookieKey = "CookieWA";
var CookieValue = $request.headers['Cookie'];
if ($nobyda.read(CookieKey)) {
if ($nobyda.read(CookieKey) != CookieValue) {
var cookie = $nobyda.write(CookieValue, CookieKey);
if (!cookie) {
$nobyda.notify("", "", "更新" + CookieName + "Cookie失败 ‼️");
} else {
$nobyda.notify("", "", "更新" + CookieName + "Cookie成功 🎉");
}
}
} else {
var cookie = $nobyda.write(CookieValue, CookieKey);
if (!cookie) {
$nobyda.notify("", "", "首次写入" + CookieName + "Cookie失败 ‼️");
} else {
$nobyda.notify("", "", "首次写入" + CookieName + "Cookie成功 🎉");
}
}
} else {
$nobyda.notify("写入Cookie失败", "", "请检查匹配URL或配置内脚本类型 ‼️");
}
} catch (eor) {
$nobyda.notify("写入Cookie失败", "", "未知错误 ‼️")
console.log(JSON.stringify(eor) + "\n" + eor + "\n" + JSON.stringify($request.headers))
}
$nobyda.done();
}
function nobyda() {
const isRequest = typeof $request != "undefined"
const isSurge = typeof $httpClient != "undefined"
const isQuanX = typeof $task != "undefined"
const notify = (title, subtitle, message) => {
if (isQuanX) $notify(title, subtitle, message)
if (isSurge) $notification.post(title, subtitle, message)
}
const write = (value, key) => {
if (isQuanX) return $prefs.setValueForKey(value, key)
if (isSurge) return $persistentStore.write(value, key)
}
const read = (key) => {
if (isQuanX) return $prefs.valueForKey(key)
if (isSurge) return $persistentStore.read(key)
}
const adapterStatus = (response) => {
if (response) {
if (response.status) {
response["statusCode"] = response.status
} else if (response.statusCode) {
response["status"] = response.statusCode
}
}
return response
}
const get = (options, callback) => {
if (isQuanX) {
if (typeof options == "string") options = {
url: options
}
options["method"] = "GET"
$task.fetch(options).then(response => {
callback(null, adapterStatus(response), response.body)
}, reason => callback(reason.error, null, null))
}
if (isSurge) $httpClient.get(options, (error, response, body) => {
callback(error, adapterStatus(response), body)
})
}
const done = (value = {}) => {
if (isQuanX) isRequest ? $done(value) : null
if (isSurge) isRequest ? $done(value) : $done()
}
return {
isRequest,
notify,
write,
read,
get,
done
}
};

347
BDTieBa-DailyBonus/TieBa.js Normal file
View File

@ -0,0 +1,347 @@
/*
百度贴吧签到脚本
脚本修改自: https://github.com/sazs34/TaskConfig
兼容: QuantumultX, Surge4, Loon
获取Cookie说明
打开百度贴吧App后(AppStore中国区, 非内部版)点击"我的", 如通知成功获取cookie, 则可以使用此签到脚本.
获取Cookie后, 请将Cookie脚本禁用并移除主机名以免产生不必要的MITM.
脚本将在每天上午9:00执行, 您可以修改执行时间
************************
Surge 4.2.0+ 脚本配置:
************************
[Script]
贴吧签到 = type=cron,cronexp=0 9 * * *,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/BDTieBa-DailyBonus/TieBa.js
贴吧获取Cookie = type=http-request,pattern=https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/BDTieBa-DailyBonus/TieBa.js
[MITM]
hostname= c.tieba.baidu.com
************************
QuantumultX 本地脚本配置:
************************
[task_local]
# 贴吧签到
0 9 * * * TieBa.js
[rewrite_local]
# 获取Cookie
https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login url script-request-header TieBa.js
[mitm]
hostname= c.tieba.baidu.com
************************
Loon 2.1.0+ 脚本配置:
************************
[Script]
# 贴吧签到
cron "0 9 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/BDTieBa-DailyBonus/TieBa.js
# 获取Cookie
http-request https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login script-path=https://raw.githubusercontent.com/NobyDa/Script/master/BDTieBa-DailyBonus/TieBa.js
[Mitm]
hostname= c.tieba.baidu.com
*/
var $nobyda = nobyda();
var cookieVal = $nobyda.read("CookieTB");
var done = $nobyda.done();
var useParallel = 0; //0自动切换,1串行,2并行(当贴吧数量大于30个以后,并行可能会导致QX崩溃,所以您可以自动切换)
var singleNotifyCount = 20; //想签到几个汇总到一个通知里,这里就填几个(比如我有13个要签到的,这里填了5,就会分三次消息通知过去)
var process = {
total: 0,
result: [
// {
// bar:'',
// level:0,
// exp:0,
// errorCode:0,
// errorMsg:''
// }
]
};
var url_fetch_sign = {
url: "https://tieba.baidu.com/mo/q/newmoindex",
headers: {
"Content-Type": "application/octet-stream",
Referer: "https://tieba.baidu.com/index/tbwise/forum",
Cookie: cookieVal,
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A366"
}
};
var url_fetch_add = {
url: "https://tieba.baidu.com/sign/add",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Cookie: cookieVal,
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/14B100 UCBrowser/10.7.5.650 Mobile"
},
body: ""
};
if ($nobyda.isRequest) {
GetCookie()
} else {
signTieBa()
}
function signTieBa() {
if (!cookieVal) {
$nobyda.notify("贴吧签到", "签到失败", "未获取到cookie");
return;
}
$nobyda.get(url_fetch_sign, function(error, response, data) {
if (error) {
$nobyda.notify("贴吧签到", "签到失败", "未获取到签到列表");
} else {
// $nobyda.notify("贴吧签到", "贴吧列表", response.body);
var body = JSON.parse(response.body);
var isSuccessResponse = body && body.no == 0 && body.error == "success" && body.data.tbs;
if (!isSuccessResponse) {
$nobyda.notify("贴吧签到", "签到失败", (body && body.error) ? body.error : "接口数据获取失败");
return;
}
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);
}
}
} else {
$nobyda.notify("贴吧签到", "签到失败", "请确认您有关注的贴吧");
return;
}
}
})
}
function signBar(bar, tbs) {
if (bar.is_sign == 1) { //已签到的,直接不请求接口了
process.result.push({
bar: `${bar.forum_name}`,
level: bar.user_level,
exp: bar.user_exp,
errorCode: 9999,
errorMsg: "已签到"
});
checkIsAllProcessed();
} else {
url_fetch_add.body = `tbs=${tbs}&kw=${bar.forum_name}&ie=utf-8`;
$nobyda.post(url_fetch_add, function(error, response, data) {
if (error) {
process.result.push({
bar: bar.forum_name,
errorCode: 999,
errorMsg: '接口错误'
});
checkIsAllProcessed();
} else {
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) {
$nobyda.notify("贴吧签到", "贴吧签到数据处理异常", JSON.stringify(e));
}
checkIsAllProcessed();
}
})
}
}
function signBars(bars, tbs, index) {
//$nobyda.notify("贴吧签到", `进度${index}/${bars.length}`, "");
if (index >= bars.length) {
//$nobyda.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`;
$nobyda.post(url_fetch_add, function(error, response, data) {
if (error) {
process.result.push({
bar: bar.forum_name,
errorCode: 999,
errorMsg: '接口错误'
});
signBars(bars, tbs, ++index);
} else {
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) {
$nobyda.notify("贴吧签到", "贴吧签到数据处理异常", JSON.stringify(e));
}
signBars(bars, tbs, ++index)
}
})
}
}
}
function checkIsAllProcessed() {
//$nobyda.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 = "";
var spliceArr = process.result.splice(0, singleNotifyCount);
var notifySuccessCount = 0;
for (const res of spliceArr) {
if (res.errorCode == 0 || res.errorCode == 9999) {
notifySuccessCount++;
}
if (res.errorCode == 9999) {
notify += `${res.bar}】已经签到,当前等级${res.level},经验${res.exp}
`;
} else {
notify += `${res.bar}${res.errorCode==0?'签到成功':'签到失败'}${res.errorCode==0?res.errorMsg:('原因:'+res.errorMsg)}
`;
}
}
$nobyda.notify("贴吧签到", `签到${spliceArr.length}个,成功${notifySuccessCount}`, notify);
}
}
function GetCookie() {
var headerCookie = $request.headers["Cookie"];
if (headerCookie) {
if ($nobyda.read("CookieTB") != undefined) {
if ($nobyda.read("CookieTB") != headerCookie) {
if (headerCookie.indexOf("BDUSS") != -1) {
var cookie = $nobyda.write(headerCookie, "CookieTB");
if (!cookie) {
$nobyda.notify("更新贴吧Cookie失败‼", "", "");
} else {
$nobyda.notify("更新贴吧Cookie成功 🎉", "", "");
}
}
}
} else {
if (headerCookie.indexOf("BDUSS") != -1) {
var cookie = $nobyda.write(headerCookie, "CookieTB");
if (!cookie) {
$nobyda.notify("首次写入贴吧Cookie失败‼", "", "");
} else {
$nobyda.notify("首次写入贴吧Cookie成功 🎉", "", "");
}
}
}
}
}
function nobyda() {
const isRequest = typeof $request != "undefined"
const isSurge = typeof $httpClient != "undefined"
const isQuanX = typeof $task != "undefined"
const notify = (title, subtitle, message) => {
if (isQuanX) $notify(title, subtitle, message)
if (isSurge) $notification.post(title, subtitle, message)
}
const write = (value, key) => {
if (isQuanX) return $prefs.setValueForKey(value, key)
if (isSurge) return $persistentStore.write(value, key)
}
const read = (key) => {
if (isQuanX) return $prefs.valueForKey(key)
if (isSurge) return $persistentStore.read(key)
}
const adapterStatus = (response) => {
if (response) {
if (response.status) {
response["statusCode"] = response.status
} else if (response.statusCode) {
response["status"] = response.statusCode
}
}
return response
}
const get = (options, callback) => {
if (isQuanX) {
if (typeof options == "string") options = {
url: options
}
options["method"] = "GET"
$task.fetch(options).then(response => {
callback(null, adapterStatus(response), response.body)
}, reason => callback(reason.error, null, null))
}
if (isSurge) $httpClient.get(options, (error, response, body) => {
callback(error, adapterStatus(response), body)
})
}
const post = (options, callback) => {
if (isQuanX) {
if (typeof options == "string") options = {
url: options
}
options["method"] = "POST"
$task.fetch(options).then(response => {
callback(null, adapterStatus(response), response.body)
}, reason => callback(reason.error, null, null))
}
if (isSurge) {
$httpClient.post(options, (error, response, body) => {
callback(error, adapterStatus(response), body)
})
}
}
const done = (value = {}) => {
if (isQuanX) isRequest ? $done(value) : null
if (isSurge) isRequest ? $done(value) : $done()
}
return {
isRequest,
notify,
write,
read,
get,
post,
done
}
};

View File

@ -3,13 +3,13 @@
hostname = *.iqiyi.com, www.52pojie.cn, c.tieba.baidu.com, api.m.jd.com, manga.bilibili.com,
# iQIYI Get cookie
https?:\/\/.*\.iqiyi\.com\/.*authcookie= url script-request-header NobyDa/QuantumultX/iQIYI-DailyBonus/iQIYI_GetCookie_QX.js
https?:\/\/.*\.iqiyi\.com\/.*authcookie= url script-request-header NobyDa/iQIYI-DailyBonus/iQIYI.js
# 52pojie Get cookie
https:\/\/www\.52pojie\.cn\/home\.php\?mod=space url script-request-header NobyDa/QuantumultX/52pojie-DailyBonus/52pojie_GetCookie_QX.js
https:\/\/www\.52pojie\.cn\/home\.php\?mod=space url script-request-header NobyDa/52pojie-DailyBonus/52pojie.js
# Tieba Get cookie
https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login url script-request-header NobyDa/QuantumultX/TieBa-DailyBonus/TieBa_GetCookie_QX.js
https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login url script-request-header NobyDa/BDTieBa-DailyBonus/TieBa.js
# JingDong Get cookie
https:\/\/api\.m\.jd\.com\/client\.action.*functionId=signBean url script-request-header NobyDa/JD-DailyBonus/JD_DailyBonus.js

View File

@ -1,16 +1,18 @@
#!name=Get cookie. By NobyDa
#!desc=该模块适用于定时签到脚本的Cookie获取. 集成: 京东, 吾爱破解, 爱奇艺, 哔哩哔哩漫画. 您可以在使用后手动将其禁用以免产生不必要的MITM.
#!desc=该模块适用于定时签到脚本的Cookie获取. 集成: 京东, 吾爱破解, 爱奇艺, 哔哩哔哩漫画, 百度贴吧, 您可以在使用后手动将其禁用以免产生不必要的MITM.
#!system=ios
[Script]
Get-Cookie.js = type=http-request,pattern=https:\/\/www\.52pojie\.cn\/home\.php\?,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/52pojieDailyBonus/Get-Cookie.js
吾爱Cookie = type=http-request,pattern=https:\/\/www\.52pojie\.cn\/home\.php\?,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/52pojie-DailyBonus/52pojie.js
iQIYI_GetCookie.js = type=http-request,pattern=https?:\/\/.*\.iqiyi\.com\/.*authcookie=,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Surge/iQIYI-DailyBonus/iQIYI_GetCookie.js
爱奇艺Cookie = type=http-request,pattern=https?:\/\/.*\.iqiyi\.com\/.*authcookie=,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
Manga.js = type=http-request,pattern=https:\/\/manga\.bilibili\.com\/.*\.User\/GetWallet,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Bilibili-DailyBonus/Manga.js
哔哩漫画Cookie = type=http-request,pattern=https:\/\/manga\.bilibili\.com\/.*\.User\/GetWallet,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/Bilibili-DailyBonus/Manga.js
JD_DailyBonus.js = type=http-request,pattern=https:\/\/api\.m\.jd\.com\/client\.action.*functionId=signBean,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
贴吧Cookie = type=http-request,pattern=https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/BDTieBa-DailyBonus/TieBa.js
京东签到Cookie = type=http-request,pattern=https:\/\/api\.m\.jd\.com\/client\.action.*functionId=signBean,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
[MITM]
hostname = %APPEND% *.iqiyi.com, www.52pojie.cn, api.m.jd.com, manga.bilibili.com
hostname = %APPEND% *.iqiyi.com, www.52pojie.cn, api.m.jd.com, manga.bilibili.com, c.tieba.baidu.com