Init project

This commit is contained in:
blackmatrix7
2021-04-09 19:34:05 +08:00
parent af86d24757
commit f2b8201076
7329 changed files with 2323074 additions and 0 deletions

View File

@ -0,0 +1,13 @@
/*
利用 GitHub Education 解锁 Working Copy
启用此脚本后再 Safari 打开 https://workingcopy.app/education/ 点击「tap here to access all pro features.」中的 here 跳转到 Working Copy登录自己的 GitHub 账号即可解锁
http-response ^https:\/\/education\.github\.com\/api\/user$ requires-body=1,max-size=0,script-path=scripts/WorkingCopy.js
MitM = education.github.com
作者 @ImSingee请勿外传
*/
$done({body: '{"student": true}'})

View File

@ -0,0 +1,4 @@
$done({
body: $request.body
.replace(/storefrontId\" ?: ?\".+?\"/,'storefrontId" : "143441-1,29"')
})

View File

@ -0,0 +1,313 @@
/*
爱奇艺会员签到脚本
更新时间: 2020.9.6
脚本兼容: QuantumultX, Surge4, Loon, JsBox, Node.js
电报频道: @NobyDa
问题反馈: @NobyDa_bot
获取Cookie说明
打开爱奇艺App后(AppStore中国区),点击"我的", 如通知成功获取cookie, 则可以使用此签到脚本.
获取Cookie后, 请将Cookie脚本禁用并移除主机名以免产生不必要的MITM.
脚本将在每天上午9:00执行, 您可以修改执行时间。
如果使用Node.js, 需自行安装'request'模块. 例: npm install request -g
JsBox, Node.js用户抓取Cookie说明
开启抓包, 打开爱奇艺App后(AppStore中国区),点击"我的" 返回抓包App 搜索请求头关键字 psp_cki= 或 P00001= 或 authcookie=
提取字母数字混合字段, 到&结束, 填入以下单引号内即可.
*/
var cookie = ''
/*********************
QuantumultX 远程脚本配置:
**********************
[task_local]
# 爱奇艺会员签到
0 9 * * * https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
[rewrite_local]
# 获取Cookie
^https?:\/\/iface(\d)?\.iqiyi\.com\/ url script-request-header https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
[mitm]
hostname= ifac*.iqiyi.com
**********************
Surge 4.2.0+ 脚本配置:
**********************
[Script]
爱奇艺签到 = type=cron,cronexp=0 9 * * *,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
爱奇艺获取Cookie = type=http-request,pattern=^https?:\/\/iface(\d)?\.iqiyi\.com\/,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
[MITM]
hostname= ifac*.iqiyi.com
************************
Loon 2.1.0+ 脚本配置:
************************
[Script]
# 爱奇艺签到
cron "0 9 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
# 获取Cookie
http-request ^https?:\/\/iface(\d)?\.iqiyi\.com\/ script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js
[Mitm]
hostname= ifac*.iqiyi.com
*/
var LogDetails = false; // 响应日志
var out = 0; // 超时 (毫秒) 如填写, 则不少于3000
var $nobyda = nobyda();
(async () => {
out = $nobyda.read("iQIYI_TimeOut") || out
cookie = cookie || $nobyda.read("CookieQY")
LogDetails = $nobyda.read("iQIYI_LogDetails") === "true" ? true : LogDetails
if ($nobyda.isRequest) {
GetCookie()
} else if (cookie) {
await login();
await Checkin();
await Lottery(500);
await $nobyda.time();
} else {
$nobyda.notify("爱奇艺会员", "", "签到终止, 未获取Cookie");
}
})().finally(() => {
$nobyda.done();
})
function login() {
return new Promise(resolve => {
var URL = {
url: 'https://cards.iqiyi.com/views_category/3.0/vip_home?secure_p=iPhone&scrn_scale=0&dev_os=0&ouid=0&layout_v=6&psp_cki=' + cookie + '&page_st=suggest&app_k=8e48946f144759d86a50075555fd5862&dev_ua=iPhone8%2C2&net_sts=1&cupid_uid=0&xas=1&init_type=6&app_v=11.4.5&idfa=0&app_t=0&platform_id=0&layout_name=0&req_sn=0&api_v=0&psp_status=0&psp_uid=451953037415627&qyid=0&secure_v=0&req_times=0',
headers: {
sign: '7fd8aadd90f4cfc99a858a4b087bcc3a',
t: '479112291'
}
}
$nobyda.get(URL, function(error, response, data) {
const Details = LogDetails ? data ? `response:\n${data}` : '' : ''
if (!error && data.match(/\"text\":\"\d.+?\u5230\u671f\"/)) {
$nobyda.expire = data.match(/\"text\":\"(\d.+?\u5230\u671f)\"/)[1]
console.log(`爱奇艺-查询成功: ${$nobyda.expire} ${Details}`)
} else {
console.log(`爱奇艺-查询失败${error || ': 无到期数据 ⚠️'} ${Details}`)
}
resolve()
})
if (out) setTimeout(resolve, out)
})
}
function Checkin() {
return new Promise(resolve => {
var URL = {
url: 'https://tc.vip.iqiyi.com/taskCenter/task/queryUserTask?autoSign=yes&P00001=' + cookie
}
$nobyda.get(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.continueSignDaysSum;
$nobyda.data = "签到成功: " + AwardName + quantity + ", 已连签" + continued + "天 🎉"
console.log(`爱奇艺-${$nobyda.data} ${Details}`)
} else {
$nobyda.data = "签到失败: " + obj.data.signInfo.msg + " ⚠️"
console.log(`爱奇艺-${$nobyda.data} ${Details}`)
}
} else {
$nobyda.data = "签到失败: Cookie无效 ⚠️"
console.log(`爱奇艺-${$nobyda.data} ${Details}`)
}
}
resolve()
})
if (out) setTimeout(resolve, out)
})
}
function Lottery(s) {
return new Promise(resolve => {
$nobyda.times++
const URL = {
url: 'https://iface2.iqiyi.com/aggregate/3.0/lottery_activity?app_k=0&app_v=0&platform_id=0&dev_os=0&dev_ua=0&net_sts=0&qyid=0&psp_uid=0&psp_cki=' + cookie + '&psp_status=0&secure_p=0&secure_v=0&req_sn=0'
}
setTimeout(() => {
$nobyda.get(URL, async function(error, response, data) {
if (error) {
$nobyda.data += "\n抽奖失败: 接口请求出错 ‼️"
console.log(`爱奇艺-抽奖失败: 接口请求出错 ‼️ ${error} (${$nobyda.times})`)
//$nobyda.notify("爱奇艺", "", $nobyda.data)
} else {
const obj = JSON.parse(data);
const Details = LogDetails ? `response:\n${data}` : ''
$nobyda.last = data.match(/(机会|已经)用完/) ? true : false
if (obj.awardName && obj.code == 0) {
$nobyda.data += !$nobyda.last ? `\n抽奖成功: ${obj.awardName.replace(/《.+》/, "未中奖")} 🎉` : `\n抽奖失败: 今日已抽奖 ⚠️`
console.log(`爱奇艺-抽奖明细: ${obj.awardName.replace(/《.+》/, "未中奖")} 🎉 (${$nobyda.times}) ${Details}`)
} else if (data.match(/\"errorReason\"/)) {
msg = data.match(/msg=.+?\)/) ? data.match(/msg=(.+?)\)/)[1].replace(/用户(未登录|不存在)/, "Cookie无效") : ""
$nobyda.data += `\n抽奖失败: ${msg || `未知错误`} ⚠️`
console.log(`爱奇艺-抽奖失败: ${msg || `未知错误`} ⚠️ (${$nobyda.times}) ${msg ? Details : `response:\n${data}`}`)
} else {
$nobyda.data += "\n抽奖错误: 已输出日志 ⚠️"
console.log(`爱奇艺-抽奖失败: \n${data} (${$nobyda.times})`)
}
}
if (!$nobyda.last && $nobyda.times < 3) {
await Lottery(s)
} else {
const expires = $nobyda.expire ? $nobyda.expire.replace(/\u5230\u671f/, "") : "获取失败 ⚠️"
if (!$nobyda.isNode) $nobyda.notify("爱奇艺", "到期时间: " + expires, $nobyda.data)
}
resolve()
})
}, s)
if (out) setTimeout(resolve, out + s)
})
}
function GetCookie() {
var CKA = $request.url.match(/(psp_cki=|P00001=|authcookie=)([A-Za-z0-9]+)/)
var CKB = JSON.stringify($request.headers).match(/(psp_cki=|P00001=|authcookie=)([A-Za-z0-9]+)/)
var iQIYI = CKA || CKB || null
var RA = $nobyda.read("CookieQY")
if (iQIYI) {
if (RA != iQIYI[2]) {
var OldTime = $nobyda.read("CookieQYTime")
if (!$nobyda.write(iQIYI[2], "CookieQY")) {
$nobyda.notify(`${RA?`更新`:`首次写入`}爱奇艺签到Cookie失败‼`, "", "")
} else {
if (!OldTime || OldTime && (Date.now() - OldTime) / 1000 >= 21600) {
$nobyda.write(JSON.stringify(Date.now()), "CookieQYTime")
$nobyda.notify(`${RA?`更新`:`首次写入`}爱奇艺签到Cookie成功 🎉`, "", "")
} else {
console.log(`\n更新爱奇艺Cookie成功! 🎉\n检测到频繁通知, 已转为输出日志`)
}
}
} else {
console.log("\n爱奇艺-与本机储存Cookie相同, 跳过写入 ⚠️")
}
} else {
console.log("\n爱奇艺-请求不含Cookie, 跳过写入 ‼️")
}
}
function nobyda() {
const times = 0
const start = Date.now()
const isRequest = typeof $request != "undefined"
const isSurge = typeof $httpClient != "undefined"
const isQuanX = typeof $task != "undefined"
const isLoon = typeof $loon != "undefined"
const isJSBox = typeof $app != "undefined" && typeof $http != "undefined"
const isNode = typeof require == "function" && !isJSBox;
const node = (() => {
if (isNode) {
const request = require('request');
return ({
request
})
} else {
return (null)
}
})()
const notify = (title, subtitle, message) => {
if (isQuanX) $notify(title, subtitle, message)
if (isSurge) $notification.post(title, subtitle, message)
if (isNode) log('\n' + title + '\n' + subtitle + '\n' + message)
if (isJSBox) $push.schedule({
title: title,
body: subtitle ? subtitle + "\n" + message : 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)
})
if (isNode) {
node.request(options, (error, response, body) => {
callback(error, adapterStatus(response), body)
})
}
if (isJSBox) {
if (typeof options == "string") options = {
url: options
}
options["header"] = options["headers"]
options["handler"] = function(resp) {
let error = resp.error;
if (error) error = JSON.stringify(resp.error)
let body = resp.data;
if (typeof body == "object") body = JSON.stringify(resp.data);
callback(error, adapterStatus(resp.response), body)
};
$http.get(options);
}
}
const log = (message) => console.log(message)
const time = () => {
const end = ((Date.now() - start) / 1000).toFixed(2)
return console.log('\n签到用时: ' + end + ' 秒')
}
const done = (value = {}) => {
if (isQuanX) return $done(value)
if (isSurge) isRequest ? $done(value) : $done()
}
return {
isRequest,
isNode,
notify,
write,
read,
get,
log,
time,
times,
done
}
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
var body = $response.body;
var url = $request.url;
const path1 = '/api/subscriptions/2.1/user-subscriptions/';
let obj = JSON.parse(body);
if (url.indexOf(path1) != -1) {
obj.user_subscription["expires_on_sec"] = 1655536094;
obj.user_subscription["expired"] = false;
obj.user_subscription["payment_type"] = 2;
obj.user_subscription["is_trial_period"] = true;
obj.user_subscription["starts_on_sec"] = 1560831070;
obj.user_subscription["is_active"] = true;
obj.user_subscription["auto_renew"] = true;
obj.user_subscription["last_verified_sec"] = 1560831070;
obj.user_subscription["subscription_code"] = "VSCOANNUAL";
obj.user_subscription["user_id"] = 54624336;
obj.user_subscription["source"] = 1;
body = JSON.stringify(obj);
}
$done({body});

View File

@ -0,0 +1,330 @@
/*
READMEhttps://github.com/yichahucha/surge/tree/master
*/
const path1 = "serverConfig";
const path2 = "wareBusiness";
const path3 = "basicConfig";
const consolelog = false;
const url = $request.url;
const body = $response.body;
const $tool = tool();
if (url.indexOf(path1) != -1) {
let obj = JSON.parse(body);
delete obj.serverConfig.httpdns;
delete obj.serverConfig.dnsvip;
delete obj.serverConfig.dnsvip_v6;
$done({ body: JSON.stringify(obj) });
}
if (url.indexOf(path3) != -1) {
let obj = JSON.parse(body);
let JDHttpToolKit = obj.data.JDHttpToolKit;
if (JDHttpToolKit) {
delete obj.data.JDHttpToolKit.httpdns;
delete obj.data.JDHttpToolKit.dnsvipV6;
}
$done({ body: JSON.stringify(obj) });
}
if (url.indexOf(path2) != -1) {
let obj = JSON.parse(body);
const floors = obj.floors;
const commodity_info = floors[floors.length - 1];
const shareUrl = commodity_info.data.property.shareUrl;
request_history_price(shareUrl, function (data) {
if (data) {
const lowerword = adword_obj();
lowerword.data.ad.textColor = "#fe0000";
let bestIndex = 0;
for (let index = 0; index < floors.length; index++) {
const element = floors[index];
if (element.mId == lowerword.mId) {
bestIndex = index + 1;
break;
} else {
if (element.sortId > lowerword.sortId) {
bestIndex = index;
break;
}
}
}
if (data.ok == 1 && data.single) {
const lower = lowerMsgs(data.single)
const detail = priceSummary(data)
const tip = data.PriceRemark.Tip + "(仅供参考)"
lowerword.data.ad.adword = `${lower} ${tip}\n${detail}`;
floors.insert(bestIndex, lowerword);
}
if (data.ok == 0 && data.msg.length > 0) {
lowerword.data.ad.adword = "⚠️ " + data.msg;
floors.insert(bestIndex, lowerword);
}
$done({ body: JSON.stringify(obj) });
} else {
$done({ body });
}
})
}
function lowerMsgs(data) {
const lower = data.lowerPriceyh
const lowerDate = dateFormat(data.lowerDateyh)
const lowerMsg = "🍵 历史最低到手价:¥" + String(lower) + ` (${lowerDate}) `
return lowerMsg
}
function priceSummary(data) {
let summary = ""
let listPriceDetail = data.PriceRemark.ListPriceDetail.slice(0,4)
let list = listPriceDetail.concat(historySummary(data.single))
list.forEach((item, index) => {
if (item.Name == "双11价格") {
item.Name = "双十一价格"
} else if (item.Name == "618价格") {
item.Name = "六一八价格"
}
summary += `\n${item.Name}${getSpace(8)}${item.Price}${getSpace(8)}${item.Date}${getSpace(8)}${item.Difference}`
})
return summary
}
function historySummary(single) {
const rexMatch = /\[.*?\]/g;
const rexExec = /\[(.*),(.*),"(.*)".*\]/;
let currentPrice, lowest30, lowest90, lowest180, lowest360
let list = single.jiagequshiyh.match(rexMatch);
list = list.reverse().slice(0, 360);
list.forEach((item, index) => {
if (item.length > 0) {
const result = rexExec.exec(item);
const dateUTC = new Date(eval(result[1]));
const date = dateUTC.format("yyyy-MM-dd");
let price = parseFloat(result[2]);
if (index == 0) {
currentPrice = price
lowest30 = { Name: "三十天最低", Price: `¥${String(price)}`, Date: date, Difference: difference(currentPrice, price), price }
lowest90 = { Name: "九十天最低", Price: `¥${String(price)}`, Date: date, Difference: difference(currentPrice, price), price }
lowest180 = { Name: "一百八最低", Price: `¥${String(price)}`, Date: date, Difference: difference(currentPrice, price), price }
lowest360 = { Name: "三百六最低", Price: `¥${String(price)}`, Date: date, Difference: difference(currentPrice, price), price }
}
if (index < 30 && price < lowest30.price) {
lowest30.price = price
lowest30.Price = `¥${String(price)}`
lowest30.Date = date
lowest30.Difference = difference(currentPrice, price)
}
if (index < 90 && price < lowest90.price) {
lowest90.price = price
lowest90.Price = `¥${String(price)}`
lowest90.Date = date
lowest90.Difference = difference(currentPrice, price)
}
if (index < 180 && price < lowest180.price) {
lowest180.price = price
lowest180.Price = `¥${String(price)}`
lowest180.Date = date
lowest180.Difference = difference(currentPrice, price)
}
if (index < 360 && price < lowest360.price) {
lowest360.price = price
lowest360.Price = `¥${String(price)}`
lowest360.Date = date
lowest360.Difference = difference(currentPrice, price)
}
}
});
return [lowest30, lowest90, lowest180, lowest360];
}
function difference(currentPrice, price) {
let difference = sub(currentPrice, price)
if (difference == 0) {
return "-"
} else {
return `${difference > 0 ? "↑" : "↓"}${String(difference)}`
}
}
function sub(arg1, arg2) {
return add(arg1, -Number(arg2), arguments[2]);
}
function add(arg1, arg2) {
arg1 = arg1.toString(), arg2 = arg2.toString();
var arg1Arr = arg1.split("."), arg2Arr = arg2.split("."), d1 = arg1Arr.length == 2 ? arg1Arr[1] : "", d2 = arg2Arr.length == 2 ? arg2Arr[1] : "";
var maxLen = Math.max(d1.length, d2.length);
var m = Math.pow(10, maxLen);
var result = Number(((arg1 * m + arg2 * m) / m).toFixed(maxLen));
var d = arguments[2];
return typeof d === "number" ? Number((result).toFixed(d)) : result;
}
function request_history_price(share_url, callback) {
const options = {
url: "https://apapia-history.manmanbuy.com/ChromeWidgetServices/WidgetServices.ashx",
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 - mmbWebBrowse - ios"
},
body: "methodName=getHistoryTrend&p_url=" + encodeURIComponent(share_url)
}
$tool.post(options, function (error, response, data) {
if (!error) {
callback(JSON.parse(data));
if (consolelog) console.log("Data:\n" + data);
} else {
callback(null, null);
if (consolelog) console.log("Error:\n" + error);
}
})
}
function dateFormat(cellval) {
const date = new Date(parseInt(cellval.replace("/Date(", "").replace(")/", ""), 10));
const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
const currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
return date.getFullYear() + "-" + month + "-" + currentDate;
}
function getSpace(length) {
let blank = "";
for (let index = 0; index < length; index++) {
blank += " ";
}
return blank;
}
function adword_obj() {
return {
"bId": "eCustom_flo_199",
"cf": {
"bgc": "#ffffff",
"spl": "empty"
},
"data": {
"ad": {
"adword": "",
"textColor": "#8C8C8C",
"color": "#f23030",
"newALContent": true,
"hasFold": true,
"class": "com.jd.app.server.warecoresoa.domain.AdWordInfo.AdWordInfo",
"adLinkContent": "",
"adLink": ""
}
},
"mId": "bpAdword",
"refId": "eAdword_0000000028",
"sortId": 13
}
}
function tool() {
const isSurge = typeof $httpClient != "undefined"
const isQuanX = typeof $task != "undefined"
const isResponse = typeof $response != "undefined"
const node = (() => {
if (typeof require == "function") {
const request = require('request')
return ({ request })
} else {
return (null)
}
})()
const notify = (title, subtitle, message) => {
if (isQuanX) $notify(title, subtitle, message)
if (isSurge) $notification.post(title, subtitle, message)
if (node) console.log(JSON.stringify({ 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)
})
if (node) {
node.request(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)
})
}
if (node) {
node.request.post(options, (error, response, body) => {
callback(error, adapterStatus(response), body)
})
}
}
return { isQuanX, isSurge, isResponse, notify, write, read, get, post }
}
Array.prototype.insert = function (index, item) {
this.splice(index, 0, item);
};
Date.prototype.format = function (fmt) {
var o = {
"y+": this.getFullYear(),
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S+": this.getMilliseconds()
};
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
if (k == "y+") {
fmt = fmt.replace(RegExp.$1, ("" + o[k]).substr(4 - RegExp.$1.length));
}
else if (k == "S+") {
var lens = RegExp.$1.length;
lens = lens == 1 ? 3 : lens;
fmt = fmt.replace(RegExp.$1, ("00" + o[k]).substr(("" + o[k]).length - 1, lens));
}
else {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
}
return fmt;
}

View File

@ -0,0 +1,84 @@
try {
let body = $response.body.replace(/\"room_id\":(\d{2,})/g,'"room_id":"$1"');
let obj = JSON.parse(body);
if (obj.data) obj.data = filter_data(obj.data);
if (obj.aweme_list) obj.aweme_list = filter_list(obj.aweme_list);
if (obj.aweme_detail) obj.aweme_detail = filter_detail(obj.aweme_detail);
if (obj.aweme_details) obj.aweme_details = filter_details(obj.aweme_details);
$done({ body: JSON.stringify(obj) });
} catch (error) {
console.log("脚本处理时遇到些问题,响应不会被修改\n" + error);
$done({});
}
function filter_data(data) {
for (var i = data.length - 1; i >= 0; i--) {
if (data[i].aweme_info) {
if (data[i].aweme_info.is_ads === true) {
data.splice(i, 1);
} else if (data[i].aweme_info.video) {
data[i].aweme_info.status.reviewed = 1;
data[i].aweme_info.video_control.prevent_download_type = 0;
data[i].aweme_info.video_control.allow_download = true;
delete data[i].aweme_info.video.misc_download_addrs;
let play = data[i].aweme_info.video.play_addr.url_list;
data[i].aweme_info.video.download_addr.url_list = play;
let download = data[i].aweme_info.video.download_addr;
data[i].aweme_info.video.download_suffix_logo_addr = download;
}
}
if (data[i].aweme) {
data[i].aweme.video_control.allow_download = true;
data[i].aweme.video_control.prevent_download_type = 0;
data[i].aweme.status.reviewed = 1;
delete data[i].aweme.video.misc_download_addrs;
let play = data[i].aweme.video.play_addr.url_list;
data[i].aweme.video.download_addr.url_list = play;
let download = data[i].aweme.video.download_addr;
data[i].aweme.video.download_suffix_logo_addr = download;
}
}
return data;
}
function filter_list(list) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i].video && list[i].is_ads != true) {
list[i].video_control.allow_download = true;
list[i].video_control.prevent_download_type = 0;
list[i].status.reviewed = 1;
delete list[i].video.misc_download_addrs;
let play = list[i].video.play_addr.url_list;
list[i].video.download_addr.url_list = play;
let download = list[i].video.download_addr;
list[i].video.download_suffix_logo_addr = download;
} else {
list.splice(i, 1);
}
}
return list;
}
function filter_detail(detail) {
detail.status.reviewed = 1;
detail.video_control.allow_download = true;
detail.video_control.prevent_download_type = 0;
let play = detail.video.play_addr.url_list;
detail.video.download_addr.url_list = play;
let download = detail.video.download_addr;
detail.video.download_suffix_logo_addr = download;
return detail;
}
function filter_details(details) {
for (var i = details.length - 1; i >= 0; i--) {
details[i].status.reviewed = 1;
details[i].video_control.allow_download = true;
details[i].video_control.prevent_download_type = 0;
let play = details[i].video.play_addr.url_list;
details[i].video.download_addr.url_list = play;
let download = details[i].video.download_addr;
details[i].video.download_suffix_logo_addr = download;
}
return details;
}

View File

@ -0,0 +1,43 @@
/*
克拉壁纸解锁付费壁纸
Surge4
http-response ^https:\/\/claritywallpaper\.com\/clarity\/api\/(userInfo|special\/queryByCatalogAll) requires-body=1,max-size=262144,script-path=resources/js/clarity.js
QX
^https:\/\/claritywallpaper\.com\/clarity\/api\/(userInfo|special\/queryByCatalogAll) url script-response-body clarity.js
Surge & QX MITM = claritywallpaper.com
*/
/*
克拉壁纸解锁付费壁纸
Surge4
http-response ^https:\/\/claritywallpaper\.com\/clarity\/api\/(userInfo|special\/queryByCatalogAll) requires-body=1,max-size=262144,script-path=resources/js/clarity.js
QX
^https:\/\/claritywallpaper\.com\/clarity\/api\/(userInfo|special\/queryByCatalogAll) url script-response-body clarity.js
Surge & QX MITM = claritywallpaper.com
*/
var body = $response.body;
var url = $request.url;
var obj = JSON.parse(body);
const userinfo = '/userInfo';
const setfree = '/special/queryByCatalogAll';
if (url.indexOf(setfree) != -1) {
for (var i = 0; i < obj.data.length; i++) {
obj.data[i].isFree = true;
}
body = JSON.stringify(obj);
}
if (url.indexOf(userinfo) != -1) {
obj.data.level = 5;
obj.data.expireTime = 4070965662;
body = JSON.stringify(obj);
}
$done({body});

View File

@ -0,0 +1,8 @@
/*
不背单词解锁装备 @Ljm666888
https://sapi.beingfine.cn/v3/report/launch/
不背单词解锁装备 = type=http-response,pattern=^https:\/\/sapi\.beingfine\.cn\/v3\/report\/launch\/,requires-body=1,max-size=0,script-path=bubei.js,
*/
let obj = JSON.parse($response.body);
obj.data_body = obj.data_body.replace(/expire_date":\d+/g, 'expire_date":1884436316000').replace(/granted":\d+/g, 'granted":1').replace(/user_type":\d+/g, 'user_type":3').replace(/collins_user_type":\d+/g, 'collins_user_type":3');
$done({body: JSON.stringify(obj)});