Skip to content

Commit

Permalink
refactor: modkit
Browse files Browse the repository at this point in the history
Update modkit.dev.config.ts
  • Loading branch information
VirgilClyne committed Nov 10, 2024
1 parent 070516c commit 0bdb871
Showing 1 changed file with 55 additions and 39 deletions.
94 changes: 55 additions & 39 deletions modkit.dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,63 @@ export default defineConfig({
date: new Date().toLocaleString("zh-CN"),
},
},
content: {
rule: [
"DOMAIN,gateway.icloud.com,{{{Proxy}}}",
{
type: "RULE-SET",
assetKey: "News.list",
policyName: {
custom: "{{{Proxy}}}",
content: ({ pluginName }) => {
const content: ModuleContent = {
rule: [],
script: [
{
name: "📰 News.v1.configs.request",
type: "http-request",
pattern: "^https?://news(-todayconfig)?-edge.apple.com/v1/configs",
requiresBody: true,
scriptKey: "request",
injectArgument: true,
},
description: "📰 News",
},
],
script: [
{
name: "📰 News.v1.configs.request",
type: "http-request",
pattern: "^https?://news(-todayconfig)?-edge.apple.com/v1/configs",
requiresBody: true,
scriptKey: "request",
injectArgument: true,
},
{
name: "📰 News.analyticseventsv2.async.request",
type: "http-request",
pattern: "^https?://news(-sports)?-events.apple.com/analyticseventsv2/async",
requiresBody: true,
scriptKey: "request",
injectArgument: true,
},
{
name: "📰 News.v1.search.request",
type: "http-request",
pattern: "^https?://news-client-search.apple.com/v1/search",
requiresBody: false,
scriptKey: "request",
injectArgument: true,
{
name: "📰 News.analyticseventsv2.async.request",
type: "http-request",
pattern: "^https?://news(-sports)?-events.apple.com/analyticseventsv2/async",
requiresBody: true,
scriptKey: "request",
injectArgument: true,
},
{
name: "📰 News.v1.search.request",
type: "http-request",
pattern: "^https?://news-client-search.apple.com/v1/search",
requiresBody: false,
scriptKey: "request",
injectArgument: true,
},
],
mitm: {
hostname: ["news-edge.apple.com", "news-todayconfig-edge.apple.com", "news-events.apple.com", "news-sports-events.apple.com", "news-client.apple.com", "news-client-search.apple.com"],
},
],
mitm: {
hostname: ["news-edge.apple.com", "news-todayconfig-edge.apple.com", "news-events.apple.com", "news-sports-events.apple.com", "news-client.apple.com", "news-client-search.apple.com"],
},
};
switch (pluginName) {
case "surge":
content.rule.push("DOMAIN,gateway.icloud.com,{{{Proxy}}} //☁️ iCloud");
content.rule.push({
type: "RULE-SET",
assetKey: "News.list",
policyName: {
custom: "{{{Proxy}}}",
},
description: "📰 News",
});
break;
case "loon":
content.rule.push("# > iCloud");
content.rule.push("DOMAIN,gateway.icloud.com,PROXY");
content.rule.push("# > News");
content.rule.push("DOMAIN,news-edge.apple.com,PROXY");
content.rule.push("DOMAIN,news-events.apple.com,PROXY");
content.rule.push("DOMAIN,apple.comscoreresearch.com,PROXY");
content.rule.push("# News+ Audio");
content.rule.push("URL-REGEX,^https?:\/\/news-assets\.apple\.com\/(audio-narrative|podcast\/audio)\/.*,PROXY");
break;
};
return content;
},
arguments: [
{
Expand Down

0 comments on commit 0bdb871

Please sign in to comment.