[feature]: Generate the hosts file from the Adblock file
The 1Blocker rules are generated from the Adblock file using generate_rules.py: would it be possible to generate the hosts file in a similar way?
That's possible, but the result will be erroneous because script doesn't know whether it's okay to block the whole domain.
For example, there are some rules starting with youtube.com:
||youtube.com/get_midroll_info^
||youtube.com/get_video_info?*el=adunit
||youtube.com/youtubei/v1/player/ad_break^
Then the script will generate youtube.com in the hosts.txt. Maybe generating only $third-party rules can be effective. Unfortunately, current YousList hasn't been precise for $third-party.
Instead of making hosts.txt a proper hostsfile, generate a file that has the raw domains and filter out domains that are contained in separate whitelist file, like whitelist.txt.
https://github.com/FiltersHeroes/ScriptsPlayground/blob/master/Readme_SFLB.md
@HOSTSinclude section_file_name- converts direct blocking rules of section/filterlist into the hosts format and include it into the final filterlist file (converting is always done on temporary files).
Only I won't help you if you are stuck at the stage of running this on your computer or repository after through the github/gitlab/CircleCi action.
The script has excluded filter with path processing per domain block action, so it should not block access to YouTube.
I can't promise that if you find a bug I will know how to fix it.