From 84f08b13ac6918636e08868516c64135a6c26588 Mon Sep 17 00:00:00 2001 From: chouchoui Date: Thu, 15 Jul 2021 09:34:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90bilibili=E3=80=91=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=20banner=20=E5=B9=BF=E5=91=8A=EF=BC=8C?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=20tab=20=E9=A1=B5=E5=BC=80=E6=94=BE=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E8=B4=AD=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bilibili/bilibili_plus.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/script/bilibili/bilibili_plus.js b/script/bilibili/bilibili_plus.js index 1aad2b4e9..77991d4f4 100644 --- a/script/bilibili/bilibili_plus.js +++ b/script/bilibili/bilibili_plus.js @@ -26,7 +26,9 @@ if (magicJS.read(blackKey)) { if (item.hasOwnProperty("banner_item")) { let bannerItems = []; for (let banner of item["banner_item"]) { - if (banner["is_ad"] != true && banner["is_ad_loc"] != true) { + if (banner["type"] === "ad") { + continue; + } else if (banner["static_banner"] && banner["static_banner"]["is_ad_loc"] != true) { bannerItems.push(banner); } } @@ -126,9 +128,15 @@ if (magicJS.read(blackKey)) { case /^https?:\/\/app\.bilibili\.com\/x\/v2\/account\/mine/.test(magicJS.request.url): try { let obj = JSON.parse(magicJS.response.body); - // 425 开始为概念版id - const itemList = new Set([396, 397, 398, 399, 171, 172, 534, 8, 4, 428, 352, 1, 405, 402, 404, 544, 407, 410, 425, 426, 427, 428, 171, 430, 431, 432]); + // 622 为会员购中心, 425 开始为概念版id + const itemList = new Set([396, 397, 398, 399, 171, 172, 534, 8, 4, 428, 352, 1, 405, 402, 404, 544, 407, 410, 622, 425, 426, 427, 428, 171, 430, 431, 432]); obj["data"]["sections_v2"].forEach((element, index) => { + element["items"].forEach((e) => { + if (e["id"] === 622) { + e["title"] = "会员购"; + e["uri"] = "bilibili://mall/home"; + } + }); let items = element["items"].filter((e) => { return itemList.has(e.id); });