mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Update CDN & Global & Reject Hosts
This commit is contained in:
@@ -141,9 +141,7 @@ export const DOMAIN_LISTS_EXTRA: HostsSource[] = [
|
||||
// Not actively maintained, let's consider it is dead
|
||||
// [
|
||||
// 'https://cdn.jsdelivr.net/gh/Spam404/lists@master/main-blacklist.txt',
|
||||
// [
|
||||
// 'https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt'
|
||||
// ],
|
||||
// ['https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt'],
|
||||
// true
|
||||
// ]
|
||||
];
|
||||
@@ -198,8 +196,8 @@ export const ADGUARD_FILTERS: AdGuardFilterSource[] = [
|
||||
'https://secure.fanboy.co.nz/easyprivacy.txt',
|
||||
'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easyprivacy.txt',
|
||||
'https://ublockorigin.pages.dev/thirdparties/easyprivacy.txt',
|
||||
'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easyprivacy.txt',
|
||||
'https://filters.adtidy.org/extension/ublock/filters/118_optimized.txt'
|
||||
'https://filters.adtidy.org/extension/ublock/filters/118_optimized.txt',
|
||||
'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easyprivacy.txt'
|
||||
]
|
||||
],
|
||||
// AdGuard Base Filter: Use AdGuard Base Filter w/ EasyList
|
||||
@@ -229,13 +227,14 @@ export const ADGUARD_FILTERS: AdGuardFilterSource[] = [
|
||||
['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt']
|
||||
],
|
||||
// PiHoleBlocklist
|
||||
// Update almost once per 3 months, let's set a 10 days cache ttl
|
||||
[
|
||||
'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
|
||||
[
|
||||
'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
|
||||
]
|
||||
],
|
||||
// Hasn't been updated for two years. Merged to reject.conf
|
||||
// [
|
||||
// 'https://cdn.jsdelivr.net/gh/Perflyst/PiHoleBlocklist@master/SmartTV-AGH.txt',
|
||||
// [
|
||||
// 'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
|
||||
// 'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
|
||||
// ]
|
||||
// ],
|
||||
// uBlock Origin Unbreak
|
||||
[
|
||||
'https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.min.txt',
|
||||
@@ -548,5 +547,16 @@ export const PREDEFINED_WHITELIST = [
|
||||
// Expired domains
|
||||
'.expobarrio.com',
|
||||
'.hamdandates.com',
|
||||
'.amzone.co.jp'
|
||||
'.amzone.co.jp',
|
||||
|
||||
// Migrate from SmartTV-AGH List
|
||||
'mhc-ajax-eu.myhomescreen.tv',
|
||||
'mhc-ajax-eu-s2.myhomescreen.tv',
|
||||
'mhc-xpana-eu.myhomescreen.tv',
|
||||
'mhc-xpana-eu-s2.myhomescreen.tv',
|
||||
'infolink.pavv.co.kr',
|
||||
'hbbtv.zdf.de',
|
||||
'hbbtv.prosieben.de',
|
||||
'hbbtv.redbutton.de',
|
||||
'hbbtv.kika.de'
|
||||
];
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable unused-imports/no-unused-vars -- some unused methods */
|
||||
import path from 'node:path';
|
||||
import { processFilterRulesWithPreload } from './lib/parse-filter/filters';
|
||||
import { processHosts } from './lib/parse-filter/hosts';
|
||||
@@ -10,7 +11,8 @@ import runAgainstSourceFile from './lib/run-against-source-file';
|
||||
(async () => {
|
||||
const trie = new HostnameSmolTrie();
|
||||
|
||||
await writeHostsToTrie(trie, 'https://cdn.jsdelivr.net/gh/jerryn70/GoodbyeAds@master/Extension/GoodbyeAds-Xiaomi-Extension.txt', true);
|
||||
// await writeHostsToTrie(trie, 'https://cdn.jsdelivr.net/gh/jerryn70/GoodbyeAds@master/Extension/GoodbyeAds-Xiaomi-Extension.txt', true);
|
||||
const { whiteDomainSuffixes, whiteDomains } = await writeFiltersToTrie(trie, 'https://cdn.jsdelivr.net/gh/Perflyst/PiHoleBlocklist@master/SmartTV-AGH.txt', true);
|
||||
|
||||
const callback = (domain: string, includeAllSubDomain: boolean) => {
|
||||
trie.whitelist(domain, includeAllSubDomain);
|
||||
@@ -26,6 +28,11 @@ import runAgainstSourceFile from './lib/run-against-source-file';
|
||||
console.log('---------------------------');
|
||||
console.log(trie.dump().join('\n'));
|
||||
console.log('---------------------------');
|
||||
console.log('whitelist domain suffixes:');
|
||||
console.log(whiteDomainSuffixes.join('\n'));
|
||||
console.log('---------------------------');
|
||||
console.log('whitelist domains:');
|
||||
console.log(whiteDomains.join('\n'));
|
||||
})();
|
||||
|
||||
async function writeHostsToTrie(trie: HostnameSmolTrie, hostsUrl: string, includeAllSubDomain = false) {
|
||||
@@ -36,7 +43,6 @@ async function writeHostsToTrie(trie: HostnameSmolTrie, hostsUrl: string, includ
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-vars -- ready to use function
|
||||
async function writeFiltersToTrie(trie: HostnameSmolTrie, filterUrl: string, includeThirdParty = false) {
|
||||
const { whiteDomainSuffixes, whiteDomains, blackDomainSuffixes, blackDomains } = await processFilterRulesWithPreload(filterUrl, [], includeThirdParty)(dummySpan);
|
||||
for (let i = 0, len = blackDomainSuffixes.length; i < len; i++) {
|
||||
@@ -51,4 +57,6 @@ async function writeFiltersToTrie(trie: HostnameSmolTrie, filterUrl: string, inc
|
||||
for (let i = 0, len = whiteDomains.length; i < len; i++) {
|
||||
trie.whitelist(whiteDomains[i], false);
|
||||
}
|
||||
|
||||
return { whiteDomainSuffixes, whiteDomains };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user