mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 01:30:37 +08:00
Udpate CDN Hosts & Download Hosts
This commit is contained in:
parent
e30a5edba5
commit
7b69b62801
@ -6,8 +6,6 @@ const readline = require('readline');
|
|||||||
const { isDomainLoose } = require('./lib/is-domain-loose');
|
const { isDomainLoose } = require('./lib/is-domain-loose');
|
||||||
const tldts = require('tldts');
|
const tldts = require('tldts');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const set = new Set();
|
const set = new Set();
|
||||||
/**
|
/**
|
||||||
@ -20,9 +18,33 @@ const tldts = require('tldts');
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} domainSetPath
|
||||||
|
*/
|
||||||
|
const processLocalDomainSet = async (domainSetPath) => {
|
||||||
for await (
|
for await (
|
||||||
const line of readline.createInterface({
|
const line of readline.createInterface({
|
||||||
input: fs.createReadStream(path.resolve(__dirname, '../List/non_ip/cdn.conf')),
|
input: fs.createReadStream(domainSetPath),
|
||||||
|
crlfDelay: Infinity
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
if (line[0] === '.') {
|
||||||
|
addApexDomain(line.slice(1));
|
||||||
|
} else if (isDomainLoose(line)) {
|
||||||
|
addApexDomain(line);
|
||||||
|
} else if (!line.startsWith('#') && line.trim() !== '') {
|
||||||
|
console.warn('[drop line from domainset]', line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} ruleSetPath
|
||||||
|
*/
|
||||||
|
const processLocalRuleSet = async (ruleSetPath) => {
|
||||||
|
for await (
|
||||||
|
const line of readline.createInterface({
|
||||||
|
input: fs.createReadStream(ruleSetPath),
|
||||||
crlfDelay: Infinity
|
crlfDelay: Infinity
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
@ -30,34 +52,21 @@ const tldts = require('tldts');
|
|||||||
addApexDomain(line.replace('DOMAIN-SUFFIX,', ''))
|
addApexDomain(line.replace('DOMAIN-SUFFIX,', ''))
|
||||||
} else if (line.startsWith('DOMAIN,')) {
|
} else if (line.startsWith('DOMAIN,')) {
|
||||||
addApexDomain(line.replace('DOMAIN,', ''));
|
addApexDomain(line.replace('DOMAIN,', ''));
|
||||||
|
} else if (!line.startsWith('#') && line.trim() !== '') {
|
||||||
|
console.warn('[drop line from ruleset]', line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for await (
|
await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/cdn.conf'));
|
||||||
const line of readline.createInterface({
|
await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/global.conf'));
|
||||||
input: fs.createReadStream(path.resolve(__dirname, '../List/domainset/cdn.conf')),
|
await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/global_plus.conf'));
|
||||||
crlfDelay: Infinity
|
await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/my_proxy.conf'));
|
||||||
})
|
await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/stream.conf'));
|
||||||
) {
|
await processLocalRuleSet(path.resolve(__dirname, '../List/non_ip/telegram.conf'));
|
||||||
if (line[0] === '.') {
|
|
||||||
addApexDomain(line.slice(1));
|
|
||||||
} else if (isDomainLoose(line)) {
|
|
||||||
addApexDomain(line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for await (
|
await processLocalDomainSet(path.resolve(__dirname, '../List/domainset/cdn.conf'));
|
||||||
const line of readline.createInterface({
|
await processLocalDomainSet(path.resolve(__dirname, '../List/domainset/download.conf'));
|
||||||
input: fs.createReadStream(path.resolve(__dirname, '../List/domainset/download.conf')),
|
|
||||||
crlfDelay: Infinity
|
|
||||||
})
|
|
||||||
) {
|
|
||||||
if (line[0] === '.') {
|
|
||||||
addApexDomain(line.slice(1));
|
|
||||||
} else if (isDomainLoose(line)) {
|
|
||||||
addApexDomain(line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await fse.ensureDir(path.resolve(__dirname, '../List/internal'));
|
await fse.ensureDir(path.resolve(__dirname, '../List/internal'));
|
||||||
await fs.promises.writeFile(
|
await fs.promises.writeFile(
|
||||||
|
|||||||
@ -476,10 +476,7 @@ www.10086.win
|
|||||||
# imgix custom domain
|
# imgix custom domain
|
||||||
www.datocms-assets.com
|
www.datocms-assets.com
|
||||||
|
|
||||||
# >> Medium
|
|
||||||
cdn-client.medium.com
|
|
||||||
glyph.medium.com
|
|
||||||
miro.medium.com
|
|
||||||
|
|
||||||
# >> Shopify
|
# >> Shopify
|
||||||
cdn.shopify.com
|
cdn.shopify.com
|
||||||
@ -1152,6 +1149,7 @@ image.lichess1.org
|
|||||||
.chesscomfiles.com
|
.chesscomfiles.com
|
||||||
# adguard.com
|
# adguard.com
|
||||||
cdn.adguard.com
|
cdn.adguard.com
|
||||||
|
static.adguardvpn.com
|
||||||
# cdn.adtidy.org
|
# cdn.adtidy.org
|
||||||
# ik.me
|
# ik.me
|
||||||
.storage.infomaniak.com
|
.storage.infomaniak.com
|
||||||
@ -1239,6 +1237,9 @@ media.dlsite.com
|
|||||||
img.dlsite.jp
|
img.dlsite.jp
|
||||||
# Dribbble
|
# Dribbble
|
||||||
cdn.dribbble.com
|
cdn.dribbble.com
|
||||||
|
# flaticon.com
|
||||||
|
cdn-share-sprites.flaticon.com
|
||||||
|
media.flaticon.com
|
||||||
# spot.im
|
# spot.im
|
||||||
static-cdn.spot.im
|
static-cdn.spot.im
|
||||||
images.spot.im
|
images.spot.im
|
||||||
@ -1332,6 +1333,21 @@ cache-05.filehippo.net
|
|||||||
wp.salesforce.com
|
wp.salesforce.com
|
||||||
ui.trailhead.com
|
ui.trailhead.com
|
||||||
resources.help.salesforce.com
|
resources.help.salesforce.com
|
||||||
|
# mayoclinic.org
|
||||||
|
assets.mayoclinic.org
|
||||||
|
design.mayoclinic.org
|
||||||
|
# ubisoft
|
||||||
|
static-dm.ubisoft.com
|
||||||
|
static-overlay.ubisoft.com
|
||||||
|
staticctf.ubisoft.com
|
||||||
|
ubistatic2-a.ubisoft.com
|
||||||
|
ubistatic-a.ubisoft.com
|
||||||
|
.cdn.ubi.com
|
||||||
|
ubistatic2-a.akamaihd.net
|
||||||
|
# Medium
|
||||||
|
cdn-client.medium.com
|
||||||
|
glyph.medium.com
|
||||||
|
miro.medium.com
|
||||||
# Others
|
# Others
|
||||||
content-prod-live.cert.starbucks.com
|
content-prod-live.cert.starbucks.com
|
||||||
at.adtech.redventures.io
|
at.adtech.redventures.io
|
||||||
@ -1600,3 +1616,5 @@ hawk.tomsguide.com
|
|||||||
forest-mt-s3.seekrtech.com
|
forest-mt-s3.seekrtech.com
|
||||||
cdn.apkmonk.com
|
cdn.apkmonk.com
|
||||||
.rocketcdn.me
|
.rocketcdn.me
|
||||||
|
cdn.img.ly
|
||||||
|
.kym-cdn.com
|
||||||
|
|||||||
@ -52,3 +52,5 @@ builds.parsec.app
|
|||||||
download.sketch.com
|
download.sketch.com
|
||||||
# >> Wireshark
|
# >> Wireshark
|
||||||
.dl.wireshark.org
|
.dl.wireshark.org
|
||||||
|
# >> Mozilla
|
||||||
|
download.mozilla.org
|
||||||
|
|||||||
@ -1,26 +1,19 @@
|
|||||||
# --- Stream Service ---
|
# --- Stream Service ---
|
||||||
|
|
||||||
# >> Netflix
|
# >> Netflix
|
||||||
IP-CIDR,8.41.4.0/24,no-resolve
|
IP-CIDR,23.246.18.0/23,no-resolve
|
||||||
IP-CIDR,23.246.0.0/18,no-resolve
|
|
||||||
IP-CIDR,37.77.184.0/21,no-resolve
|
IP-CIDR,37.77.184.0/21,no-resolve
|
||||||
IP-CIDR,38.72.126.0/24,no-resolve
|
|
||||||
IP-CIDR,45.57.0.0/17,no-resolve
|
IP-CIDR,45.57.0.0/17,no-resolve
|
||||||
IP-CIDR,64.120.128.0/17,no-resolve
|
IP-CIDR,64.120.128.0/17,no-resolve
|
||||||
IP-CIDR,66.197.128.0/17,no-resolve
|
IP-CIDR,66.197.128.0/17,no-resolve
|
||||||
IP-CIDR,69.53.224.0/19,no-resolve
|
IP-CIDR,69.53.224.0/19,no-resolve
|
||||||
IP-CIDR,103.87.204.0/22,no-resolve
|
|
||||||
IP-CIDR,108.175.32.0/20,no-resolve
|
IP-CIDR,108.175.32.0/20,no-resolve
|
||||||
IP-CIDR,185.2.220.0/22,no-resolve
|
IP-CIDR,185.2.220.0/22,no-resolve
|
||||||
IP-CIDR,185.9.188.0/22,no-resolve
|
IP-CIDR,185.9.188.0/22,no-resolve
|
||||||
IP-CIDR,192.173.64.0/18,no-resolve
|
IP-CIDR,192.173.64.0/18,no-resolve
|
||||||
IP-CIDR,198.38.96.0/19,no-resolve
|
IP-CIDR,198.38.96.0/19,no-resolve
|
||||||
IP-CIDR,198.45.48.0/20,no-resolve
|
IP-CIDR,198.45.48.0/20,no-resolve
|
||||||
IP-CIDR,207.45.72.0/22,no-resolve
|
|
||||||
IP-CIDR,208.75.76.0/22,no-resolve
|
IP-CIDR,208.75.76.0/22,no-resolve
|
||||||
IP-CIDR,34.210.42.111/32,no-resolve
|
|
||||||
IP-CIDR,52.89.124.203/32,no-resolve
|
|
||||||
IP-CIDR,54.148.37.5/32,no-resolve
|
|
||||||
IP-CIDR6,2607:fb10::/32,no-resolve
|
IP-CIDR6,2607:fb10::/32,no-resolve
|
||||||
IP-CIDR6,2620:10c:7000::/44,no-resolve
|
IP-CIDR6,2620:10c:7000::/44,no-resolve
|
||||||
IP-CIDR6,2a00:86c0::/32,no-resolve
|
IP-CIDR6,2a00:86c0::/32,no-resolve
|
||||||
|
|||||||
@ -209,4 +209,4 @@ DOMAIN-SUFFIX,acm.org
|
|||||||
## JSTOR 旗下
|
## JSTOR 旗下
|
||||||
DOMAIN-SUFFIX,jstor.org
|
DOMAIN-SUFFIX,jstor.org
|
||||||
|
|
||||||
URL-REGEX,(Subject|HELO|SMTP)
|
# URL-REGEX,(Subject|HELO|SMTP)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user