You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are welcome to file a PR in this repo if the change is reasonable for most users.
The main.go progarm walks through the data path, reading all files including those in subfolder of the data path. If there are two files with the same name in different paths, like data/lista and data/subfolder/lista, rules will be mixed together in one final list.
Without modifying the source data, you can merge upstream changes smoothly later on.
Remove unwanted lists
Here's an example configuration for datprofile (assuming the file is named dat_diy.json):
For mode all, non of existing lists would be removed; for mode allowlist, only allowed lists remains in the generated .dat file; for mode denylist, only denied lists will be removed.
Run go run ./main.go --datprofile='./dat_diy.json', and you will get three .dat files.
This approach does not require modifying the source data and carries no risk of breaking the inclusion chain. As long as the source data is consistent, any list remains in the trimed dat contains the same rules comparing to the list in full dat.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Append rules to an existing list
You are welcome to file a PR in this repo if the change is reasonable for most users.
The main.go progarm walks through the data path, reading all files including those in subfolder of the data path. If there are two files with the same name in different paths, like
data/listaanddata/subfolder/lista, rules will be mixed together in one final list.Without modifying the source data, you can merge upstream changes smoothly later on.
Remove unwanted lists
Here's an example configuration for datprofile (assuming the file is named
dat_diy.json):[ { "name": "dlc.dat", "mode": "all" }, { "name": "dlc_tiny.dat", "mode": "allowlist", "lists": [ "category-ads-all", "geolocation-cn", "geolocation-!cn" ] }, { "name": "dlc_nobackward.dat", "mode": "denylist", "lists": [ "archive", "category-ai-chat-!cn", "category-games", "cn", "google-gemini", "speedtest" ] } ]For mode all, non of existing lists would be removed; for mode allowlist, only allowed lists remains in the generated
.datfile; for mode denylist, only denied lists will be removed.Run
go run ./main.go --datprofile='./dat_diy.json', and you will get three.datfiles.This approach does not require modifying the source data and carries no risk of breaking the inclusion chain. As long as the source data is consistent, any list remains in the trimed dat contains the same rules comparing to the list in full dat.
An exmaple script to create custom dats
Beta Was this translation helpful? Give feedback.
All reactions