mirror of
https://gitlab.com/SukkaW/ruleset.skk.moe.git
synced 2026-04-19 10:24:27 +00:00
deploy: 0dc0e7e02969f3e6b714e016eab853a289dad7a7
This commit is contained in:
@@ -107,14 +107,20 @@ async function processFilterRules (filterRulesUrl, fallbackUrls) {
|
||||
/** @type Set<string> */
|
||||
const blacklistDomainSets = new Set();
|
||||
|
||||
/** @type string[] */
|
||||
const filterRules = (
|
||||
await Promise.any(
|
||||
[filterRulesUrl, ...(fallbackUrls || [])].map(
|
||||
async url => (await fetchWithRetry(url)).text()
|
||||
let filterRules;
|
||||
try {
|
||||
/** @type string[] */
|
||||
filterRules = (
|
||||
await Promise.any(
|
||||
[filterRulesUrl, ...(fallbackUrls || [])].map(
|
||||
async url => (await fetchWithRetry(url)).text()
|
||||
)
|
||||
)
|
||||
)
|
||||
).split('\n').map(line => line.trim());
|
||||
).split('\n').map(line => line.trim());
|
||||
} catch (e) {
|
||||
console.log('Download Rule for [' + filterRulesUrl + '] failed');
|
||||
throw e;
|
||||
}
|
||||
|
||||
filterRules.forEach(line => {
|
||||
const lineStartsWithDoubleVerticalBar = line.startsWith('||');
|
||||
|
||||
Reference in New Issue
Block a user