From c100869247ea408277da704744edcae35e266a24 Mon Sep 17 00:00:00 2001 From: PRO-2684 <54608551+PRO-2684@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:28:18 +0800 Subject: [PATCH] fix: Rules with `#`; Code formatting --- outgoing.json | 20 +++++++++++++++----- shortener.json | 8 ++++++-- tracking.json | 48 ++++++++++++++++++++---------------------------- 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/outgoing.json b/outgoing.json index 3a0a1b1..f92b640 100644 --- a/outgoing.json +++ b/outgoing.json @@ -1,5 +1,5 @@ { - "51.ruyo.net/": { + "51.ruyo.net/": { "go/": { "index.html": { "description": "如有外链", @@ -11,7 +11,7 @@ } } }, - "outgoing.prod.mozaws.net/": { + "outgoing.prod.mozaws.net/": { "/v\\d/": { "/\\w+": { "description": "Mozilla 外链", @@ -207,7 +207,11 @@ "headers": { "Referer": "https://segmentfault.com/" }, - "acts": ["dom", "sel:body", "attr:data-url"], + "acts": [ + "dom", + "sel:body", + "attr:data-url" + ], "author": "PRO-2684" }, "link.uisdc.com": { @@ -607,7 +611,9 @@ "params": [ "golink" ], - "acts": ["base64"], + "acts": [ + "base64" + ], "author": "PRO-2684" }, "www.so.com/": { @@ -687,7 +693,11 @@ "index": { "description": "百度外链", "mode": "visit", - "acts": ["dom", "sel:.link", "text"], + "acts": [ + "dom", + "sel:.link", + "text" + ], "author": "PRO-2684" } } diff --git a/shortener.json b/shortener.json index b0d3249..0b23737 100644 --- a/shortener.json +++ b/shortener.json @@ -1,5 +1,5 @@ { - "b23.tv": { + "b23.tv": { "description": "哔哩哔哩短链", "mode": "redirect", "author": "PRO-2684" @@ -97,7 +97,11 @@ "/\\w+": { "description": "微博短链", "mode": "visit", - "acts": ["dom", "sel:.open-url a", "attr:href"], + "acts": [ + "dom", + "sel:.open-url a", + "attr:href" + ], "author": "PRO-2684" } }, diff --git a/tracking.json b/tracking.json index 7ac1996..3c8d506 100644 --- a/tracking.json +++ b/tracking.json @@ -13,7 +13,7 @@ ], "author": "PRO-2684" }, - "baike.baidu.com/": { + "baike.baidu.com/": { "item": { "description": "百度百科", "mode": "white", @@ -185,22 +185,19 @@ }, "music.163.com/": { "song": { - "description": "网易云音乐新链接格式", - "mode": "white", - "params": [ - "id" - ], - "author": "lz233, Cloudy" - }, - "#/": { - "song": { - "description": "网易云音乐", - "mode": "white", - "params": [ - "id" - ], - "author": "lz233" - } + "description": "网易云音乐新链接格式", + "mode": "white", + "params": [ + "id" + ], + "author": "lz233, Cloudy" + }, + "": { + "description": "网易云音乐", + "mode": "lambda", + "lambda": "if (url.hash.startsWith('#/song?')) { const p = new URLSearchParams(url.hash.slice(7)); const c = new URLSearchParams(); c.set('id', p.get('id')); url.hash = '#/song?' + c.toString(); } return url;", + "author": "lz233", + "continue": false } }, "music.apple.com/": { @@ -244,17 +241,12 @@ } } }, - "resource-minecraft.h5.163.com/": { - "#/": { - "detail": { - "description": "我的世界中国版资源分享链接", - "mode": "white", - "params": [ - "id" - ], - "author": "Cloudy" - } - } + "resource-minecraft.h5.163.com": { + "description": "我的世界中国版资源分享链接", + "mode": "lambda", + "lambda": "if (url.hash.startsWith('#/detail?')) { const p = new URLSearchParams(url.hash.slice(9)); const c = new URLSearchParams(); c.set('id', p.get('id')); url.hash = '#/detail?' + c.toString(); } return url;", + "author": "Cloudy", + "continue": false }, "search.bilibili.com": { "description": "哔哩哔哩搜索",