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(
|
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),
|
RESERVED_IPV4_CIDR.concat(cidr),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|||||||
@ -5,6 +5,7 @@ const { createRuleset } = require('./lib/create-file');
|
|||||||
const domainSorter = require('./lib/stable-sort-domain');
|
const domainSorter = require('./lib/stable-sort-domain');
|
||||||
|
|
||||||
const { Sema } = require('async-sema');
|
const { Sema } = require('async-sema');
|
||||||
|
const tldts = require('tldts');
|
||||||
const { task } = require('./lib/trace-runner');
|
const { task } = require('./lib/trace-runner');
|
||||||
const s = new Sema(2);
|
const s = new Sema(2);
|
||||||
|
|
||||||
@ -39,7 +40,7 @@ const querySpeedtestApi = async (keyword) => {
|
|||||||
/** @type {{ url: string }[]} */
|
/** @type {{ url: string }[]} */
|
||||||
const json = await res.json();
|
const json = await res.json();
|
||||||
s.release();
|
s.release();
|
||||||
return json.map(({ url }) => new URL(url).hostname);
|
return json.map(({ url }) => tldts.getHostname(url, { detectIp: false }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
s.release();
|
s.release();
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@ -114,7 +115,9 @@ const buildSpeedtestDomainSet = task(__filename, async () => {
|
|||||||
for (const hostnames of hostnameGroups) {
|
for (const hostnames of hostnameGroups) {
|
||||||
if (Array.isArray(hostnames)) {
|
if (Array.isArray(hostnames)) {
|
||||||
for (const hostname of hostnames) {
|
for (const hostname of hostnames) {
|
||||||
domains.add(hostname);
|
if (hostname) {
|
||||||
|
domains.add(hostname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user