🧣 feat: 更新 微博 相关

This commit is contained in:
sve1r 2024-02-18 16:52:10 +08:00
parent 24bb7d62ff
commit 8c1b08bafa
3 changed files with 26 additions and 24 deletions

View File

@ -6,11 +6,12 @@
// @TgChannel https://t.me/ddgksf2021
// @Contribute https://t.me/ddgksf2013_bot
// @Feedback 📮 ddgksf2013@163.com 📮
// @UpdateTime 2024-01-05
// @UpdateTime 2024-01-26
// @Attention 微博、微博国际版净化,现已二合一,使用中若有问题请发邮件!
// @Attention 使用时请注意关闭QuantumultX的[兼容性增强]开关,否则无法去除微博广告
// @Suitable 自行观看“# > ”注释内容
// @Attention 如需引用请注明出处,谢谢合作!
// @Version V2.0.93
// @Version V2.0.96
// @ScriptURL https://github.com/ddgksf2013/Rewrite/raw/master/AdBlock/Weibo.conf
// ==/UserScript==

View File

@ -1,5 +1,4 @@
const version = 'V2.0.122';
const version = 'V2.0.125';
const mainConfig = {
isDebug: !1,
@ -50,7 +49,7 @@ const mainConfig = {
mblog_menus_report: !0,
mblog_menus_apeal: !0,
mblog_menus_home: !0
}, modifyCardsUrls = ["/cardlist", "video/community_tab", "/searchall"],
}, modifyCardsUrls = ["/cardlist", "video/community_tab", "searchall"],
modifyStatusesUrls = ["statuses/friends/timeline", "statuses_unread_hot_timeline", "statuses/unread_friends_timeline", "statuses/unread_hot_timeline", "groups/timeline", "statuses/friends_timeline"],
otherUrls = {
"/profile/me": "removeHome",
@ -191,13 +190,13 @@ function removeSearchMain(e) {
}
function checkSearchWindow(e) {
return !!mainConfig.removeSearchWindow && "card" == e.category && (e.data?.itemid == "finder_window" || e.data?.itemid == "more_frame" || e.data?.card_type == 208 || e.data?.card_type == 247 || e.data?.card_type == 217 || e.data?.card_type == 101 || e.data?.card_type == 19 || e.data?.mblog?.page_info?.actionlog?.source?.includes("ad"))
return !!mainConfig.removeSearchWindow && "card" == e.category && (e.data?.itemid == "finder_window" || e.data?.itemid == 'discover_gallery' || e.data?.itemid == "more_frame" || e.data?.card_type == 208 || e.data?.card_type == 247 || e.data?.card_type == 217 || e.data?.card_type == 101 || e.data?.card_type == 19 || e.data?.mblog?.page_info?.actionlog?.source?.includes("ad"))
}
function removeSearch(e) {
if (!e.items) return e;
let t = [];
for (let o of e.items) "feed" == o.category ? isAd(o.data) || (o.data?.page_info?.video_limit && delete o.data.page_info.video_limit, t.push(o)) : "group" == o.category ? (o.items = o.items.filter(e => e.data?.card_type === 17), o.items.length > 0 && t.push(o)) : checkSearchWindow(o) || t.push(o);
for (let o of e.items) "feed" == o.category ? isAd(o.data) || (o.data?.page_info?.video_limit && delete o.data.page_info.video_limit, t.push(o)) : "group" == o.category ? (o.items = o.items.filter(e => e.data?.card_type == void 0 || e.data?.card_type === 17), o.items.length > 0 && t.push(o)) : checkSearchWindow(o) || t.push(o);
return e.items = t, e.loadedInfo && (e.loadedInfo.searchBarContent = [], e.loadedInfo.headerBack && (e.loadedInfo.headerBack.channelStyleMap = {})), log("remove_search success"), e
}
@ -213,24 +212,26 @@ function removePage(e) {
}
function removeCards(e) {
if (e.hotwords && (e.hotwords = []), !e.cards) return;
let t = [];
for (let o of e.cards) {
e.cardlistInfo?.containerid == "232082type=1" && (17 == o.card_type || 58 == o.card_type || 11 == o.card_type) && (o = {card_type: o.card_type + 1});
let i = o.card_group;
if (i && i.length > 0) {
let a = [];
for (let r of i) 118 == r.card_type || isAd(r.mblog) || -1 != JSON.stringify(r).indexOf("res_from:ads") || a.push(r);
o.card_group = a, t.push(o)
} else {
let n = o.card_type;
if ([9, 165].indexOf(n) > -1) isAd(o.mblog) || t.push(o); else {
if ([1007, 180].indexOf(n) > -1) continue;
t.push(o)
if (e.hotwords && (e.hotwords = []), e.cards) {
let t = [];
for (let o of e.cards) {
e.cardlistInfo?.containerid == "232082type=1" && (17 == o.card_type || 58 == o.card_type || 11 == o.card_type) && (o = {card_type: o.card_type + 1});
let i = o.card_group;
if (i && i.length > 0) {
let a = [];
for (let r of i) 118 == r.card_type || isAd(r.mblog) || -1 != JSON.stringify(r).indexOf("res_from:ads") || a.push(r);
o.card_group = a, t.push(o)
} else {
let n = o.card_type;
if ([9, 165].indexOf(n) > -1) isAd(o.mblog) || t.push(o); else {
if ([1007, 180].indexOf(n) > -1) continue;
t.push(o)
}
}
}
e.cards = t
}
e.cards = t
e.items && (log("data.items"), removeSearch(e))
}
function lvZhouHandler(e) {

File diff suppressed because one or more lines are too long