ソースを参照

Chore: update build tools & data source

SukkaW 3 年 前
コミット
cba717dade

+ 2 - 2
Build/build-phishing-domainset.js

@@ -71,7 +71,7 @@ const BLACK_TLD = Array.from(new Set([
   const results = [];
   Object.entries(domainCountMap).forEach(([domain, count]) => {
     if (
-      count >= 8
+      count >= 5
       && BLACK_TLD.some(tld => domain.endsWith(tld))
     ) {
       results.push('.' + domain);
@@ -79,5 +79,5 @@ const BLACK_TLD = Array.from(new Set([
   });
 
   const filePath = path.resolve(__dirname, '../List/domainset/reject_phishing.conf');
-  await fs.promises.writeFile(filePath, results.join('\n'), 'utf-8');
+  await fs.promises.writeFile(filePath, results.join('\n') + '\n', 'utf-8');
 })();

+ 18 - 14
Build/build-reject-domainset.js

@@ -38,20 +38,24 @@ const filterRuleWhitelistDomainSets = new Set(PREDEFINED_WHITELIST);
 
   // Parse from AdGuard Filters
   console.time('* Download and process AdBlock Filter Rules');
-  (await Promise.all(ADGUARD_FILTERS.map(input => {
-    if (typeof input === 'string') {
-      return processFilterRules(input);
-    }
-    if (Array.isArray(input) && input.length === 2) {
-      return processFilterRules(input[0], input[1]);
-    }
-  }))).forEach(({ white, black, foundDebugDomain }) => {
-    if (foundDebugDomain) {
-      process.exit(1);
-    };
-    white.forEach(i => filterRuleWhitelistDomainSets.add(i));
-    black.forEach(i => domainSets.add(i));
-  });
+  await Promise.all(ADGUARD_FILTERS.map(input => {
+    const promise = Array.isArray(input) && input.length === 2
+      ? processFilterRules(input[0], input[1])
+      : processFilterRules(input);
+
+    return promise.then((i) => {
+      if (i) {
+        const { white, black, foundDebugDomain } = i;
+        if (foundDebugDomain) {
+          process.exit(1);
+        };
+        white.forEach(i => filterRuleWhitelistDomainSets.add(i));
+        black.forEach(i => domainSets.add(i));
+      } else {
+        process.exit(1);
+      }
+    });
+  }));
 
   console.timeEnd('* Download and process AdBlock Filter Rules');
 

+ 7 - 0
Build/lib/reject-data-source.js

@@ -88,6 +88,13 @@ const ADGUARD_FILTERS = [
   'https://filters.adtidy.org/extension/ublock/filters/7.txt',
   // AdGuard Chinese filter (EasyList China + AdGuard Chinese filter)
   'https://filters.adtidy.org/extension/ublock/filters/224.txt',
+  // EasyList Germany filter
+  [
+    'https://easylist.to/easylistgermany/easylistgermany.txt',
+    [
+      'https://easylist-downloads.adblockplus.org/easylistgermany.txt'
+    ]
+  ],
   // Easy Privacy
   [
     'https://easylist.to/easylist/easyprivacy.txt',