2019-11-29 21:39:49 +08:00
|
|
|
/*
|
|
|
|
Weibo remove start up ads
|
2020-08-09 20:27:52 +08:00
|
|
|
by yichahucha
|
2019-11-29 21:39:49 +08:00
|
|
|
[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 = "/interface/sdk/sdkad.php";
|
|
|
|
const path2 = "/wbapplua/wbpullad.lua";
|
|
|
|
|
|
|
|
const url = $request.url;
|
|
|
|
var body = $response.body;
|
|
|
|
|
|
|
|
if (url.indexOf(path1) != -1) {
|
|
|
|
let re = /\{.*\}/;
|
|
|
|
body = body.match(re);
|
|
|
|
var obj = JSON.parse(body);
|
|
|
|
if (obj.background_delay_display_time) obj.background_delay_display_time = 60*60*24*365;
|
|
|
|
if (obj.show_push_splash_ad) obj.show_push_splash_ad = false;
|
|
|
|
if (obj.ads) obj.ads = [];
|
|
|
|
body = JSON.stringify(obj) + 'OK';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (url.indexOf(path2) != -1) {
|
|
|
|
var obj = JSON.parse(body);
|
|
|
|
if (obj.cached_ad && obj.cached_ad.ads) obj.cached_ad.ads = [];
|
|
|
|
body = JSON.stringify(obj);
|
|
|
|
}
|
|
|
|
|
2020-08-09 20:27:52 +08:00
|
|
|
$done({body});
|