mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Minor fixes
This commit is contained in:
parent
31d021dd23
commit
d80ea1ecd8
@ -32,7 +32,12 @@ const buildInternalReverseChnCIDR = task(__filename, async () => {
|
||||
]);
|
||||
|
||||
const reversedCidr = exclude(
|
||||
['0.0.0.0/0'],
|
||||
[
|
||||
'0.0.0.0/0',
|
||||
// https://github.com/misakaio/chnroutes2/issues/25
|
||||
'223.118.0.0/15',
|
||||
'223.120.0.0/15'
|
||||
],
|
||||
RESERVED_IPV4_CIDR.concat(cidr),
|
||||
true
|
||||
);
|
||||
|
||||
@ -5,6 +5,7 @@ const { createRuleset } = require('./lib/create-file');
|
||||
const domainSorter = require('./lib/stable-sort-domain');
|
||||
|
||||
const { Sema } = require('async-sema');
|
||||
const tldts = require('tldts');
|
||||
const { task } = require('./lib/trace-runner');
|
||||
const s = new Sema(2);
|
||||
|
||||
@ -39,7 +40,7 @@ const querySpeedtestApi = async (keyword) => {
|
||||
/** @type {{ url: string }[]} */
|
||||
const json = await res.json();
|
||||
s.release();
|
||||
return json.map(({ url }) => new URL(url).hostname);
|
||||
return json.map(({ url }) => tldts.getHostname(url, { detectIp: false }));
|
||||
} catch (e) {
|
||||
s.release();
|
||||
console.log(e);
|
||||
@ -114,10 +115,12 @@ const buildSpeedtestDomainSet = task(__filename, async () => {
|
||||
for (const hostnames of hostnameGroups) {
|
||||
if (Array.isArray(hostnames)) {
|
||||
for (const hostname of hostnames) {
|
||||
if (hostname) {
|
||||
domains.add(hostname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const deduped = domainDeduper(Array.from(domains)).sort(domainSorter);
|
||||
const description = [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user