Is your feature request related to a problem? Please describe:
I prefer to use one of the other hosts lists from StevenBlack over his base list. To do this with hblock I have to copy all sources from the hblock source code into a sources.list file and replace a single line with my desired StevenBlock URL.
If an update to hblock changes the builtin sources, such as between 3.4.0 and 3.4.2 which I've just downloaded, these changes are not implemented on my computer until I manually update my sources.list file accordingly.
I would like some way to add and / or exclude specific hosts lists without completely overriding the whole builtin list, which then "breaks" any updates to the list within hblock itself.
Describe the solution you'd like:
I propose to either add some sort of syntax to the sources.list file or to add 2 more source files. Users can then add and exclude individual URLs, or substitute builtin sources by using both add and exclude together.
Adding new source list files is rather self-explanatory: the existing sources.list to ignore builtins and only parse the user's list, a sources-add.list file for URLs to download as well as the builtins, and a sources-exclude.list file for sources which are in the builtin list but the user wants hblock to ignore.
For the idea of keeping a single sources.list file but giving it some form of syntax, I was thinking something like:
if sources.list only contains URLs with no prefix then hblock will only use sources.list and not the builtin list
if all lines in sources.list have a prefix then hblock will parse both the builtin and the contents of sources.list
URLs with a + prefix will be downloaded in addition to the builtin list
URLs with a - prefix will be excluded if found in the builtin list
INFO output will be shown if a +URL matches something in the builtin list or a -URL is not in the builtin
WARNING (non-fatal error) output will be shown if a user has put the same URL in sources.list with both prefixes (in this case I would suggest honouring the prefix found on the last occurrence for that URL in sources.list, reading from top to bottom)
ERROR (fatal) will be shown to users if sources.list contains a mix of URLs with and without prefixes so they can correct things, and hblock will terminate without updating /etc/hosts
Of course, lines with the # prefix should continue to be totally ignored as they currently are, to allow users to temporarily disable custom sources or to comment their source list.
Describe alternatives you've considered:
I have looked through the .md files in this repo and the output of hblock --help but cannot see any way to create a list of custom sources which is update-safe.
Is your feature request related to a problem? Please describe: I prefer to use one of the other hosts lists from StevenBlack over his base list. To do this with
hblock
I have to copy all sources from thehblock
source code into asources.list
file and replace a single line with my desired StevenBlock URL.If an update to
hblock
changes the builtin sources, such as between 3.4.0 and 3.4.2 which I've just downloaded, these changes are not implemented on my computer until I manually update mysources.list
file accordingly.I would like some way to add and / or exclude specific hosts lists without completely overriding the whole builtin list, which then "breaks" any updates to the list within
hblock
itself.Describe the solution you'd like: I propose to either add some sort of syntax to the
sources.list
file or to add 2 more source files. Users can then add and exclude individual URLs, or substitute builtin sources by using both add and exclude together.Adding new source list files is rather self-explanatory: the existing
sources.list
to ignore builtins and only parse the user's list, asources-add.list
file for URLs to download as well as the builtins, and asources-exclude.list
file for sources which are in the builtin list but the user wantshblock
to ignore.For the idea of keeping a single
sources.list
file but giving it some form of syntax, I was thinking something like:sources.list
only contains URLs with no prefix thenhblock
will only usesources.list
and not the builtin listsources.list
have a prefix thenhblock
will parse both the builtin and the contents ofsources.list
+
prefix will be downloaded in addition to the builtin list-
prefix will be excluded if found in the builtin list+
URL matches something in the builtin list or a-
URL is not in the builtinsources.list
with both prefixes (in this case I would suggest honouring the prefix found on the last occurrence for that URL insources.list
, reading from top to bottom)sources.list
contains a mix of URLs with and without prefixes so they can correct things, andhblock
will terminate without updating/etc/hosts
Of course, lines with the
#
prefix should continue to be totally ignored as they currently are, to allow users to temporarily disable custom sources or to comment their source list.For example:
Describe alternatives you've considered: I have looked through the
.md
files in this repo and the output ofhblock --help
but cannot see any way to create a list of custom sources which is update-safe.Additional context: None.