🧩 优化脚本存放路径
This commit is contained in:
parent
9319803b4e
commit
a16e9ab3bf
|
@ -1,12 +1,16 @@
|
||||||
/*
|
/*
|
||||||
Remove the WeChat public account bottom ad
|
微信 去除公众号文章底部广告
|
||||||
by Choler
|
|
||||||
QX:
|
***************************
|
||||||
^https?:\/\/mp\.weixin\.qq\.com\/mp\/getappmsgad url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/Wechat.js
|
QuantumultX:
|
||||||
Surge4:
|
|
||||||
http-response ^https?:\/\/mp\.weixin\.qq\.com\/mp\/getappmsgad requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/Wechat.js
|
[rewrite_local]
|
||||||
Surge & QX MITM = mp.weixin.qq.com,
|
^https?:\/\/mp\.weixin\.qq\.com\/mp\/getappmsgad url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Wechat/Wechat.js
|
||||||
*/
|
|
||||||
|
[mitm]
|
||||||
|
hostname = mp.weixin.qq.com
|
||||||
|
|
||||||
|
**************************/
|
||||||
|
|
||||||
var obj = JSON.parse($response.body);
|
var obj = JSON.parse($response.body);
|
||||||
obj.advertisement_num = 0;
|
obj.advertisement_num = 0;
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Weibo remove ads
|
README:https://github.com/yichahucha/surge/tree/master
|
||||||
|
|
||||||
[rewrite_local]
|
|
||||||
^https?://m?api\.weibo\.c(n|om)/2/(statuses/(unread|extend|positives/get|(friends|video)(/|_)timeline)|stories/(video_stream|home_list)|(groups|fangle)/timeline|profile/statuses|comments/build_comments|photo/recommend_list|service/picfeed|searchall|cardlist|page|\!/photos/pic_recommend_status) url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/wb_ad.js
|
|
||||||
^https?://(sdk|wb)app\.uve\.weibo\.com(/interface/sdk/sdkad.php|/wbapplua/wbpullad.lua) url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/wb_launch.js
|
|
||||||
[mitm]
|
|
||||||
hostname = api.weibo.cn, mapi.weibo.com, *.uve.weibo.com
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const path1 = "/groups/timeline";
|
const path1 = "/groups/timeline";
|
||||||
|
@ -26,16 +20,22 @@ const path15 = "/statuses/video_timeline";
|
||||||
const path16 = "/page";
|
const path16 = "/page";
|
||||||
const path17 = "/statuses/friends_timeline";
|
const path17 = "/statuses/friends_timeline";
|
||||||
const path18 = "/!/photos/pic_recommend_status";
|
const path18 = "/!/photos/pic_recommend_status";
|
||||||
|
const path19 = "/statuses/video_mixtimeline";
|
||||||
|
const path20 = "/video/tiny_stream_video_list";
|
||||||
|
const path21 = "/photo/info";
|
||||||
|
const path22 = "/live/media_homelist";
|
||||||
|
const path23 = "/remind/unread_count";
|
||||||
|
|
||||||
const url = $request.url;
|
const url = $request.url;
|
||||||
var body = $response.body;
|
let body = $response.body;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
url.indexOf(path1) != -1 ||
|
url.indexOf(path1) !== -1 ||
|
||||||
url.indexOf(path2) != -1 ||
|
url.indexOf(path2) !== -1 ||
|
||||||
url.indexOf(path10) != -1 ||
|
url.indexOf(path10) !== -1 ||
|
||||||
url.indexOf(path15) != -1 ||
|
url.indexOf(path15) !== -1 ||
|
||||||
url.indexOf(path17) != -1
|
url.indexOf(path17) !== -1 ||
|
||||||
|
url.indexOf(path20) !== -1
|
||||||
) {
|
) {
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
if (obj.statuses) obj.statuses = filter_timeline_statuses(obj.statuses);
|
if (obj.statuses) obj.statuses = filter_timeline_statuses(obj.statuses);
|
||||||
|
@ -44,15 +44,11 @@ if (
|
||||||
if (obj.num) obj.num = obj.original_num;
|
if (obj.num) obj.num = obj.original_num;
|
||||||
if (obj.trends) obj.trends = [];
|
if (obj.trends) obj.trends = [];
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
} else if (url.indexOf(path3) !== -1) {
|
||||||
|
|
||||||
if (url.indexOf(path3) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
if (obj.trend) delete obj.trend;
|
if (obj.trend) delete obj.trend;
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
} else if (url.indexOf(path4) !== -1) {
|
||||||
|
|
||||||
if (url.indexOf(path4) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
obj.recommend_max_id = 0;
|
obj.recommend_max_id = 0;
|
||||||
if (obj.status) {
|
if (obj.status) {
|
||||||
|
@ -65,16 +61,11 @@ if (url.indexOf(path4) != -1) {
|
||||||
obj.datas = [];
|
obj.datas = [];
|
||||||
}
|
}
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
} else if (url.indexOf(path5) !== -1 || url.indexOf(path18) !== -1) {
|
||||||
|
|
||||||
if (url.indexOf(path5) != -1 ||
|
|
||||||
url.indexOf(path18) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
obj.data = {};
|
obj.data = {};
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
} else if (url.indexOf(path6) !== -1) {
|
||||||
|
|
||||||
if (url.indexOf(path6) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
let segments = obj.segments;
|
let segments = obj.segments;
|
||||||
if (segments && segments.length > 0) {
|
if (segments && segments.length > 0) {
|
||||||
|
@ -82,42 +73,46 @@ if (url.indexOf(path6) != -1) {
|
||||||
while (i--) {
|
while (i--) {
|
||||||
const element = segments[i];
|
const element = segments[i];
|
||||||
let is_ad = element.is_ad;
|
let is_ad = element.is_ad;
|
||||||
if (is_ad && is_ad == true) segments.splice(i, 1);
|
if (is_ad && is_ad === true) segments.splice(i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
} else if (url.indexOf(path7) !== -1) {
|
||||||
|
|
||||||
if (url.indexOf(path7) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
obj.datas = [];
|
obj.datas = [];
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
} else if (url.indexOf(path8) !== -1) {
|
||||||
|
|
||||||
if (url.indexOf(path8) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
obj.story_list = [];
|
obj.story_list = [];
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
} else if (url.indexOf(path11) !== -1 || url.indexOf(path22) !== -1) {
|
||||||
|
|
||||||
if (url.indexOf(path11) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
obj.data = [];
|
obj.data = [];
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
} else if (
|
||||||
|
url.indexOf(path9) !== -1 ||
|
||||||
if (
|
url.indexOf(path12) !== -1 ||
|
||||||
url.indexOf(path9) != -1 ||
|
url.indexOf(path13) !== -1 ||
|
||||||
url.indexOf(path12) != -1 ||
|
url.indexOf(path14) !== -1 ||
|
||||||
url.indexOf(path13) != -1 ||
|
url.indexOf(path16) !== -1
|
||||||
url.indexOf(path14) != -1 ||
|
|
||||||
url.indexOf(path16) != -1
|
|
||||||
) {
|
) {
|
||||||
let obj = JSON.parse(body);
|
let obj = JSON.parse(body);
|
||||||
if (obj.cards) obj.cards = filter_timeline_cards(obj.cards);
|
if (obj.cards) obj.cards = filter_timeline_cards(obj.cards);
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
|
} else if (url.indexOf(path19) !== -1) {
|
||||||
|
let obj = JSON.parse(body);
|
||||||
|
delete obj.expandable_view;
|
||||||
|
if (obj.hasOwnProperty("expandable_views")) delete obj.expandable_views;
|
||||||
|
body = JSON.stringify(obj);
|
||||||
|
} else if (url.indexOf(path21) !== -1) {
|
||||||
|
if (body.indexOf("ad_params") !== -1) {
|
||||||
|
body = JSON.stringify({});
|
||||||
|
}
|
||||||
|
} else if (url.indexOf(path23) !== -1) {
|
||||||
|
let obj = JSON.parse(body);
|
||||||
|
obj.video = {};
|
||||||
|
body = JSON.stringify(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
$done({ body });
|
$done({ body });
|
||||||
|
|
||||||
function filter_timeline_statuses(statuses) {
|
function filter_timeline_statuses(statuses) {
|
||||||
|
@ -125,8 +120,13 @@ function filter_timeline_statuses(statuses) {
|
||||||
let i = statuses.length;
|
let i = statuses.length;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
let element = statuses[i];
|
let element = statuses[i];
|
||||||
if (is_timeline_likerecommend(element.title)) statuses.splice(i, 1);
|
if (
|
||||||
if (is_timeline_ad(element)) statuses.splice(i, 1);
|
is_timeline_likerecommend(element.title) ||
|
||||||
|
is_timeline_ad(element) ||
|
||||||
|
is_stream_video_ad(element)
|
||||||
|
) {
|
||||||
|
statuses.splice(i, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return statuses;
|
return statuses;
|
||||||
|
@ -137,8 +137,8 @@ function filter_comments(datas) {
|
||||||
let i = datas.length;
|
let i = datas.length;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
const element = datas[i];
|
const element = datas[i];
|
||||||
let type = element.type;
|
const type = element.type;
|
||||||
if (type == 5 || type == 1 || type == 6) datas.splice(i, 1);
|
if (type === 5 || type === 1 || type === 6) datas.splice(i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return datas;
|
return datas;
|
||||||
|
@ -151,24 +151,36 @@ function filter_timeline_cards(cards) {
|
||||||
let item = cards[j];
|
let item = cards[j];
|
||||||
let card_group = item.card_group;
|
let card_group = item.card_group;
|
||||||
if (card_group && card_group.length > 0) {
|
if (card_group && card_group.length > 0) {
|
||||||
|
if (item.itemid && item.itemid === "hotword") {
|
||||||
|
filter_top_search(card_group);
|
||||||
|
} else {
|
||||||
let i = card_group.length;
|
let i = card_group.length;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
let card_group_item = card_group[i];
|
let card_group_item = card_group[i];
|
||||||
let card_type = card_group_item.card_type;
|
let card_type = card_group_item.card_type;
|
||||||
if (card_type && card_type == 9) {
|
if (card_type) {
|
||||||
if (is_timeline_ad(card_group_item.mblog)) card_group.splice(i, 1);
|
if (card_type === 9) {
|
||||||
} else if (card_type && card_type == 118) {
|
if (is_timeline_ad(card_group_item.mblog))
|
||||||
card_group.splice(i, 1);
|
card_group.splice(i, 1);
|
||||||
} else if (card_type && card_type == 42) {
|
} else if (card_type === 118 || card_type === 89) {
|
||||||
if (card_group_item.desc == '\u53ef\u80fd\u611f\u5174\u8da3\u7684\u4eba') {
|
card_group.splice(i, 1);
|
||||||
|
} else if (card_type === 42) {
|
||||||
|
if (
|
||||||
|
card_group_item.desc ===
|
||||||
|
"\u53ef\u80fd\u611f\u5174\u8da3\u7684\u4eba"
|
||||||
|
) {
|
||||||
cards.splice(j, 1);
|
cards.splice(j, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (card_type === 17) {
|
||||||
|
filter_top_search(card_group_item.group);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let card_type = item.card_type;
|
let card_type = item.card_type;
|
||||||
if (card_type && card_type == 9) {
|
if (card_type && card_type === 9) {
|
||||||
if (is_timeline_ad(item.mblog)) cards.splice(j, 1);
|
if (is_timeline_ad(item.mblog)) cards.splice(j, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,15 +189,30 @@ function filter_timeline_cards(cards) {
|
||||||
return cards;
|
return cards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function filter_top_search(group) {
|
||||||
|
if (group && group.length > 0) {
|
||||||
|
let k = group.length;
|
||||||
|
while (k--) {
|
||||||
|
let group_item = group[k];
|
||||||
|
if (group_item.hasOwnProperty("promotion")) {
|
||||||
|
group.splice(k, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function is_timeline_ad(mblog) {
|
function is_timeline_ad(mblog) {
|
||||||
if (!mblog) return false;
|
if (!mblog) return false;
|
||||||
let promotiontype = mblog.promotion && mblog.promotion.type && mblog.promotion.type == "ad";
|
let promotiontype =
|
||||||
let mblogtype = mblog.mblogtype && mblog.mblogtype == 1;
|
mblog.promotion && mblog.promotion.type && mblog.promotion.type === "ad";
|
||||||
return (promotiontype || mblogtype) ? true : false;
|
let mblogtype = mblog.mblogtype && mblog.mblogtype === 1;
|
||||||
|
return !!(promotiontype || mblogtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_timeline_likerecommend(title) {
|
function is_timeline_likerecommend(title) {
|
||||||
return title && title.type && title.type == "likerecommend" ? true : false;
|
return !!(title && title.type && title.type === "likerecommend");
|
||||||
}
|
}
|
||||||
|
|
||||||
// by yichahucha
|
function is_stream_video_ad(item) {
|
||||||
|
return item.ad_state && item.ad_state === 1;
|
||||||
|
}
|
|
@ -1,191 +1,26 @@
|
||||||
/*
|
/*
|
||||||
Weibo remove ads
|
README:https://github.com/yichahucha/surge/tree/master
|
||||||
|
|
||||||
[rewrite_local]
|
|
||||||
^https?://m?api\.weibo\.c(n|om)/2/(statuses/(unread|extend|positives/get|(friends|video)(/|_)timeline)|stories/(video_stream|home_list)|(groups|fangle)/timeline|profile/statuses|comments/build_comments|photo/recommend_list|service/picfeed|searchall|cardlist|page|\!/photos/pic_recommend_status) url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/wb_ad.js
|
|
||||||
^https?://(sdk|wb)app\.uve\.weibo\.com(/interface/sdk/sdkad.php|/wbapplua/wbpullad.lua) url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/wb_launch.js
|
|
||||||
[mitm]
|
|
||||||
hostname = api.weibo.cn, mapi.weibo.com, *.uve.weibo.com
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const path1 = "/groups/timeline";
|
const path1 = "/interface/sdk/sdkad.php";
|
||||||
const path2 = "/statuses/unread";
|
const path2 = "/wbapplua/wbpullad.lua";
|
||||||
const path3 = "/statuses/extend";
|
|
||||||
const path4 = "/comments/build_comments";
|
|
||||||
const path5 = "/photo/recommend_list";
|
|
||||||
const path6 = "/stories/video_stream";
|
|
||||||
const path7 = "/statuses/positives/get";
|
|
||||||
const path8 = "/stories/home_list";
|
|
||||||
const path9 = "/profile/statuses";
|
|
||||||
const path10 = "/statuses/friends/timeline";
|
|
||||||
const path11 = "/service/picfeed";
|
|
||||||
const path12 = "/fangle/timeline";
|
|
||||||
const path13 = "/searchall";
|
|
||||||
const path14 = "/cardlist";
|
|
||||||
const path15 = "/statuses/video_timeline";
|
|
||||||
const path16 = "/page";
|
|
||||||
const path17 = "/statuses/friends_timeline";
|
|
||||||
const path18 = "/!/photos/pic_recommend_status";
|
|
||||||
|
|
||||||
const url = $request.url;
|
const url = $request.url;
|
||||||
var body = $response.body;
|
let body = $response.body;
|
||||||
|
let obj;
|
||||||
if (
|
if (url.indexOf(path1) !== -1) {
|
||||||
url.indexOf(path1) != -1 ||
|
let re = /\{.*}/;
|
||||||
url.indexOf(path2) != -1 ||
|
body = body.match(re);
|
||||||
url.indexOf(path10) != -1 ||
|
obj = JSON.parse(body);
|
||||||
url.indexOf(path15) != -1 ||
|
if (obj.background_delay_display_time) obj.background_delay_display_time = 60*60*24*365;
|
||||||
url.indexOf(path17) != -1
|
if (obj.show_push_splash_ad) obj.show_push_splash_ad = false;
|
||||||
) {
|
if (obj.ads) obj.ads = [];
|
||||||
let obj = JSON.parse(body);
|
body = JSON.stringify(obj) + 'OK';
|
||||||
if (obj.statuses) obj.statuses = filter_timeline_statuses(obj.statuses);
|
}
|
||||||
if (obj.advertises) obj.advertises = [];
|
if (url.indexOf(path2) !== -1) {
|
||||||
if (obj.ad) obj.ad = [];
|
obj = JSON.parse(body);
|
||||||
if (obj.num) obj.num = obj.original_num;
|
if (obj.cached_ad && obj.cached_ad.ads) obj.cached_ad.ads = [];
|
||||||
if (obj.trends) obj.trends = [];
|
|
||||||
body = JSON.stringify(obj);
|
body = JSON.stringify(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.indexOf(path3) != -1) {
|
$done({body});
|
||||||
let obj = JSON.parse(body);
|
|
||||||
if (obj.trend) delete obj.trend;
|
|
||||||
body = JSON.stringify(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.indexOf(path4) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
|
||||||
obj.recommend_max_id = 0;
|
|
||||||
if (obj.status) {
|
|
||||||
if (obj.top_hot_structs) {
|
|
||||||
obj.max_id = obj.top_hot_structs.call_back_struct.max_id;
|
|
||||||
delete obj.top_hot_structs;
|
|
||||||
}
|
|
||||||
if (obj.datas) obj.datas = filter_comments(obj.datas);
|
|
||||||
} else {
|
|
||||||
obj.datas = [];
|
|
||||||
}
|
|
||||||
body = JSON.stringify(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.indexOf(path5) != -1 ||
|
|
||||||
url.indexOf(path18) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
|
||||||
obj.data = {};
|
|
||||||
body = JSON.stringify(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.indexOf(path6) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
|
||||||
let segments = obj.segments;
|
|
||||||
if (segments && segments.length > 0) {
|
|
||||||
let i = segments.length;
|
|
||||||
while (i--) {
|
|
||||||
const element = segments[i];
|
|
||||||
let is_ad = element.is_ad;
|
|
||||||
if (is_ad && is_ad == true) segments.splice(i, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
body = JSON.stringify(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.indexOf(path7) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
|
||||||
obj.datas = [];
|
|
||||||
body = JSON.stringify(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.indexOf(path8) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
|
||||||
obj.story_list = [];
|
|
||||||
body = JSON.stringify(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.indexOf(path11) != -1) {
|
|
||||||
let obj = JSON.parse(body);
|
|
||||||
obj.data = [];
|
|
||||||
body = JSON.stringify(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
url.indexOf(path9) != -1 ||
|
|
||||||
url.indexOf(path12) != -1 ||
|
|
||||||
url.indexOf(path13) != -1 ||
|
|
||||||
url.indexOf(path14) != -1 ||
|
|
||||||
url.indexOf(path16) != -1
|
|
||||||
) {
|
|
||||||
let obj = JSON.parse(body);
|
|
||||||
if (obj.cards) obj.cards = filter_timeline_cards(obj.cards);
|
|
||||||
body = JSON.stringify(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
$done({ body });
|
|
||||||
|
|
||||||
function filter_timeline_statuses(statuses) {
|
|
||||||
if (statuses && statuses.length > 0) {
|
|
||||||
let i = statuses.length;
|
|
||||||
while (i--) {
|
|
||||||
let element = statuses[i];
|
|
||||||
if (is_timeline_likerecommend(element.title)) statuses.splice(i, 1);
|
|
||||||
if (is_timeline_ad(element)) statuses.splice(i, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return statuses;
|
|
||||||
}
|
|
||||||
|
|
||||||
function filter_comments(datas) {
|
|
||||||
if (datas && datas.length > 0) {
|
|
||||||
let i = datas.length;
|
|
||||||
while (i--) {
|
|
||||||
const element = datas[i];
|
|
||||||
let type = element.type;
|
|
||||||
if (type == 5 || type == 1 || type == 6) datas.splice(i, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return datas;
|
|
||||||
}
|
|
||||||
|
|
||||||
function filter_timeline_cards(cards) {
|
|
||||||
if (cards && cards.length > 0) {
|
|
||||||
let j = cards.length;
|
|
||||||
while (j--) {
|
|
||||||
let item = cards[j];
|
|
||||||
let card_group = item.card_group;
|
|
||||||
if (card_group && card_group.length > 0) {
|
|
||||||
let i = card_group.length;
|
|
||||||
while (i--) {
|
|
||||||
let card_group_item = card_group[i];
|
|
||||||
let card_type = card_group_item.card_type;
|
|
||||||
if (card_type && card_type == 9) {
|
|
||||||
if (is_timeline_ad(card_group_item.mblog)) card_group.splice(i, 1);
|
|
||||||
} else if (card_type && card_type == 118) {
|
|
||||||
card_group.splice(i, 1);
|
|
||||||
} else if (card_type && card_type == 42) {
|
|
||||||
if (card_group_item.desc == '\u53ef\u80fd\u611f\u5174\u8da3\u7684\u4eba') {
|
|
||||||
cards.splice(j, 1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
let card_type = item.card_type;
|
|
||||||
if (card_type && card_type == 9) {
|
|
||||||
if (is_timeline_ad(item.mblog)) cards.splice(j, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return cards;
|
|
||||||
}
|
|
||||||
|
|
||||||
function is_timeline_ad(mblog) {
|
|
||||||
if (!mblog) return false;
|
|
||||||
let promotiontype = mblog.promotion && mblog.promotion.type && mblog.promotion.type == "ad";
|
|
||||||
let mblogtype = mblog.mblogtype && mblog.mblogtype == 1;
|
|
||||||
return (promotiontype || mblogtype) ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function is_timeline_likerecommend(title) {
|
|
||||||
return title && title.type && title.type == "likerecommend" ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// by yichahucha
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
百度网盘 解锁在线视频倍率/清晰度
|
||||||
|
|
||||||
|
***************************
|
||||||
|
QuantumultX:
|
||||||
|
|
||||||
|
[rewrite_local]
|
||||||
|
https:\/\/pan\.baidu\.com\/rest\/\d\.\d\/membership\/user url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/BaiduCloud.js
|
||||||
|
|
||||||
|
[mitm]
|
||||||
|
hostname = pan.baidu.com
|
||||||
|
**************************/
|
||||||
|
|
||||||
|
if ($response.body) {
|
||||||
|
$done({
|
||||||
|
body: JSON.stringify({
|
||||||
|
"product_infos": [{
|
||||||
|
"product_id": "5310897792128633390",
|
||||||
|
"start_time": 1417260485,
|
||||||
|
"end_time": 2147483648,
|
||||||
|
"buy_time": "1417260485",
|
||||||
|
"cluster": "offlinedl",
|
||||||
|
"detail_cluster": "offlinedl",
|
||||||
|
"product_name": "gz_telecom_exp"
|
||||||
|
}, {
|
||||||
|
"product_name": "svip2_nd",
|
||||||
|
"product_description": "超级会员",
|
||||||
|
"function_num": 0,
|
||||||
|
"start_time": 1553702399,
|
||||||
|
"buy_description": "",
|
||||||
|
"buy_time": 0,
|
||||||
|
"product_id": "1",
|
||||||
|
"auto_upgrade_to_svip": 0,
|
||||||
|
"end_time": 1672502399,
|
||||||
|
"cluster": "vip",
|
||||||
|
"detail_cluster": "svip",
|
||||||
|
"status": 0
|
||||||
|
}],
|
||||||
|
"currenttime": 1573473597,
|
||||||
|
"reminder": {
|
||||||
|
"reminderWithContent": [],
|
||||||
|
"advertiseContent": []
|
||||||
|
},
|
||||||
|
"request_id": 7501873289383874371
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$done({});
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
CamScanner 解锁部分高级特权
|
||||||
|
|
||||||
|
***************************
|
||||||
|
Quantumult X:
|
||||||
|
|
||||||
|
[rewrite_local]
|
||||||
|
^https:\/\/(api|api-cs)\.intsig\.net\/purchase\/cs\/query_property\? url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/CamScanner.js
|
||||||
|
|
||||||
|
[mitm]
|
||||||
|
hostname = ap*.intsig.net
|
||||||
|
|
||||||
|
**************************/
|
||||||
|
let obj = {
|
||||||
|
"data":
|
||||||
|
{
|
||||||
|
"psnl_vip_property": {
|
||||||
|
"expiry": "1687017600"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$done({body: JSON.stringify(obj)});
|
|
@ -0,0 +1,40 @@
|
||||||
|
/*
|
||||||
|
酷我音乐 解锁会员试听及部分功能
|
||||||
|
|
||||||
|
***************************
|
||||||
|
QuantumultX:
|
||||||
|
|
||||||
|
[rewrite_local]
|
||||||
|
^https?:\/\/vip1\.kuwo\.cn\/(vip\/v2\/user\/vip|vip\/spi/mservice) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/VIP/Kuwo/vip.js
|
||||||
|
|
||||||
|
[mitm]
|
||||||
|
hostname = vip1.kuwo.cn
|
||||||
|
|
||||||
|
**************************/
|
||||||
|
|
||||||
|
let body = $response.body;
|
||||||
|
const url = $request.url;
|
||||||
|
let obj = JSON.parse(body);
|
||||||
|
|
||||||
|
const vip = '/vip/v2/user/vip';
|
||||||
|
const time = '/vip/spi/mservice';
|
||||||
|
|
||||||
|
if (url.indexOf(vip) !== -1) {
|
||||||
|
obj.data["isNewUser"] = "2";
|
||||||
|
obj.data["vipLuxuryExpire"] = "1835312949000";
|
||||||
|
obj.data["time"] = "1961170340993";
|
||||||
|
obj.data["isYearUser"] = "2";
|
||||||
|
obj.data["vipmExpire"] = "1835312949000";
|
||||||
|
obj.data["vipOverSeasExpire"] = "1835312949000";
|
||||||
|
obj.data["vipExpire"] = "1835312949000";
|
||||||
|
obj.data["vip3Expire"] = "1835312949000";
|
||||||
|
body = JSON.stringify(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.indexOf(time) !== -1) {
|
||||||
|
obj["isVIPMAutoPay"] = 2;
|
||||||
|
obj["isVIPLuxAutoPay"] = 2;
|
||||||
|
body = JSON.stringify(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
$done({body});
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
Polarr泼辣修图 解锁特权 (需恢复购买)
|
||||||
|
|
||||||
|
***************************
|
||||||
|
QuantumultX:
|
||||||
|
|
||||||
|
[rewrite_local]
|
||||||
|
^https:\/\/api\.polaxiong\.com\/v1\/payments\/appleiap\/receipts\/confirmation url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Polarr.js
|
||||||
|
|
||||||
|
[mitm]
|
||||||
|
hostname = api.polaxiong.com
|
||||||
|
|
||||||
|
**************************/
|
||||||
|
|
||||||
|
const sta = typeof $task !== "undefined" ? "HTTP/1.1 200 OK" : 200;
|
||||||
|
const res = $response;
|
||||||
|
const req = $request;
|
||||||
|
|
||||||
|
if (res.body && req.method === "PUT") {
|
||||||
|
$done({
|
||||||
|
body: JSON.stringify({
|
||||||
|
"app": "PPE",
|
||||||
|
"isUnlimited": true,
|
||||||
|
"membershipExpiryDate": "2028-06-06T08:00:00.000Z"
|
||||||
|
}),
|
||||||
|
status: sta,
|
||||||
|
headers: res.headers
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$done({});
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
/********************************
|
||||||
|
Membership unlock for VSCO & 1Blocker
|
||||||
|
Please note that you may need to reinstall app for script to work.
|
||||||
|
|
||||||
|
QuantumultX rewrite link:
|
||||||
|
https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/VIP/VSCO/Unlock.js
|
||||||
|
|
||||||
|
Please note that the above rewrite link requires open KOP-XIAO's resource parser
|
||||||
|
|
||||||
|
********************************/
|
||||||
|
|
||||||
|
const resp = {};
|
||||||
|
const obj = JSON.parse(typeof $response != "undefined" && $response.body || null);
|
||||||
|
const ua = $request.headers['User-Agent'] || $request.headers['user-agent'];
|
||||||
|
const list = {
|
||||||
|
'VSCO': { name: 'membership', id: 'com.circles.fin.premium.yearly' },
|
||||||
|
'1Blocker': { name: 'premium', id: 'blocker.ios.subscription.yearly' }
|
||||||
|
};
|
||||||
|
const data = {
|
||||||
|
"expires_date": "2030-02-18T07:52:54Z",
|
||||||
|
"original_purchase_date": "2020-02-11T07:52:55Z",
|
||||||
|
"purchase_date": "2020-02-11T07:52:54Z"
|
||||||
|
};
|
||||||
|
|
||||||
|
if (typeof $response == "undefined") {
|
||||||
|
delete $request.headers["x-revenuecat-etag"]; // prevent 304 issues
|
||||||
|
delete $request.headers["X-RevenueCat-ETag"];
|
||||||
|
resp.headers = $request.headers;
|
||||||
|
} else if (obj && obj.subscriber) {
|
||||||
|
obj.subscriber.subscriptions = obj.subscriber.subscriptions || {};
|
||||||
|
obj.subscriber.entitlement = obj.subscriber.entitlement || {};
|
||||||
|
for (const i in list) {
|
||||||
|
if (new RegExp(`^${i}`, `i`).test(ua)) {
|
||||||
|
obj.subscriber.subscriptions[list[i].id] = data;
|
||||||
|
obj.subscriber.entitlements[list[i].name] = JSON.parse(JSON.stringify(data));
|
||||||
|
obj.subscriber.entitlements[list[i].name].product_identifier = list[i].id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resp.body = JSON.stringify(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
$done(resp);
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
WPS Office 解锁部分功能
|
||||||
|
|
||||||
|
***************************
|
||||||
|
QuantumultX:
|
||||||
|
|
||||||
|
[rewrite_local]
|
||||||
|
^https?:\/\/[a-z-]*account\.wps\.c(n|om)(:\d+|)\/api\/users url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Wps.js
|
||||||
|
|
||||||
|
[mitm]
|
||||||
|
hostname = *account.wps.cn, *account.wps.com
|
||||||
|
|
||||||
|
**************************/
|
||||||
|
|
||||||
|
var body = JSON.parse($response.body);
|
||||||
|
var obj = {
|
||||||
|
exp: 0,
|
||||||
|
level: 3,
|
||||||
|
privilege: [
|
||||||
|
{ spid: "data_recover", times: 0, expire_time: 1846256142 },
|
||||||
|
{ spid: "ocr", times: 0, expire_time: 1846256142 },
|
||||||
|
{ spid: "pdf2doc", times: 0, expire_time: 1846256142 },
|
||||||
|
{ spid: "pdf_merge", times: 0, expire_time: 1846256142 },
|
||||||
|
{ spid: "pdf_sign", times: 0, expire_time: 1846256142 },
|
||||||
|
{ spid: "pdf_split", times: 0, expire_time: 1846256142 }
|
||||||
|
],
|
||||||
|
result: "ok",
|
||||||
|
total_buy: 0,
|
||||||
|
total_cost: -30,
|
||||||
|
userid: body.userid,
|
||||||
|
vip: {
|
||||||
|
name: "超级会员",
|
||||||
|
has_ad: 0,
|
||||||
|
memberid: 40,
|
||||||
|
expire_time: 1846256142,
|
||||||
|
enabled: [
|
||||||
|
{ memberid: 40, name: "超级会员", expire_time: 1846256142 },
|
||||||
|
{ memberid: 20, name: "WPS会员", expire_time: 1846256142 },
|
||||||
|
{ memberid: 12, name: "稻壳会员", expire_time: 1846256142 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
wealth: 0,
|
||||||
|
expire_time: 1846256142
|
||||||
|
};
|
||||||
|
|
||||||
|
$done({ body: JSON.stringify(obj) });
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
网易蜗牛读书 解锁特权
|
||||||
|
原作者: yxiaocai & JO2EY
|
||||||
|
|
||||||
|
***************************
|
||||||
|
QuantumultX:
|
||||||
|
|
||||||
|
[rewrite_local]
|
||||||
|
^https?:\/\/p\.du\.163\.com\/gain\/readtime\/info\.json url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/VIP/Wnyd/vip.js
|
||||||
|
|
||||||
|
[mitm]
|
||||||
|
hostname = p.du.163.com
|
||||||
|
|
||||||
|
**************************/
|
||||||
|
var body = $response.body;
|
||||||
|
var obj = JSON.parse(body);
|
||||||
|
|
||||||
|
obj.tradeEndTime = 1679685290000;
|
||||||
|
body = JSON.stringify(obj);
|
||||||
|
$done({body});
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
解锁知音漫客付费章节 (需登录)
|
||||||
|
|
||||||
|
***************************
|
||||||
|
QuantumultX:
|
||||||
|
|
||||||
|
[rewrite_local]
|
||||||
|
^https:\/\/apigate\.zymk\.cn\/(zymk-getuserinfo-api\/v1\/getuserinfo|zymk-userpurchased-api\/v1\/userpurchased\/paychapters)\/ url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/VIP/Zymh/unlock.js
|
||||||
|
|
||||||
|
[mitm]
|
||||||
|
hostname = apigate.zymk.cn
|
||||||
|
|
||||||
|
**************************/
|
||||||
|
|
||||||
|
var obj = JSON.parse($response.body);
|
||||||
|
obj.status = 0;
|
||||||
|
obj.data.isvip = 1;
|
||||||
|
obj.data.coins = 6666;
|
||||||
|
obj.data.Cgold = 6666;
|
||||||
|
$done({body: JSON.stringify(obj)});
|
|
@ -1,37 +0,0 @@
|
||||||
/*
|
|
||||||
VSCO_Vip unlock vip
|
|
||||||
|
|
||||||
QX:
|
|
||||||
^https?:\/\/vsco\.co\/api\/subscriptions\/2.1\/user-subscriptions\/ url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/vsco.js
|
|
||||||
|
|
||||||
Surge4:
|
|
||||||
http-response ^https?:\/\/vsco\.co\/api\/subscriptions\/2.1\/user-subscriptions\/ requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/vsco.js
|
|
||||||
|
|
||||||
Surge & QX MITM = vsco.co
|
|
||||||
|
|
||||||
此脚本来自 NoByda
|
|
||||||
*/
|
|
||||||
|
|
||||||
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});
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"user_subscription": {
|
|
||||||
"expires_on_sec": 1655536094,
|
|
||||||
"is_intro_period": false,
|
|
||||||
"expired": false,
|
|
||||||
"payment_type": 2,
|
|
||||||
"user_id": 54624336,
|
|
||||||
"source": 1,
|
|
||||||
"is_trial_period": true,
|
|
||||||
"starts_on_sec": 1560831070,
|
|
||||||
"intro_offer_consumed": true,
|
|
||||||
"is_active": true,
|
|
||||||
"canceled_at_sec": null,
|
|
||||||
"auto_renew": true,
|
|
||||||
"is_in_grace_period": false,
|
|
||||||
"last_verified_sec": 1560831070,
|
|
||||||
"invalid_reason": null,
|
|
||||||
"subscription_code": "VSCOANNUAL"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue