Browse Source

- single/double and local lists: ignore blank/comment lines

master
bloved 1 month ago
parent
commit
aef07c50d6
3 changed files with 10 additions and 0 deletions
  1. +3
    -0
      adlist_hosts.go
  2. +3
    -0
      adlist_single.go
  3. +4
    -0
      hostfile.go

+ 3
- 0
adlist_hosts.go View File

@ -107,6 +107,9 @@ func downloadDoubleThread() {
}
s := fileByLines(ZabovDoubleBL)
for _, v := range s {
if len(v) == 0 || strings.TrimSpace(v)[0] == '#' {
continue
}
configs := _urls[v]
if configs == nil {
configs = stringarray{}

+ 3
- 0
adlist_single.go View File

@ -108,6 +108,9 @@ func downloadThread() {
s := fileByLines(ZabovSingleBL)
for _, v := range s {
if len(v) == 0 || strings.TrimSpace(v)[0] == '#' {
continue
}
configs := _urls[v]
if configs == nil {
configs = stringarray{}

+ 4
- 0
hostfile.go View File

@ -4,6 +4,7 @@ import (
"bufio"
"fmt"
"os"
"strings"
)
func init() {
@ -41,6 +42,9 @@ func ingestLocalBlacklists() {
scanner := bufio.NewScanner(file)
for scanner.Scan() {
d := scanner.Text()
if len(d) == 0 || strings.TrimSpace(d)[0] == '#' {
continue
}
DomainKill(d, ZabovHostsFile, configs)
incrementStats("Blacklist", 1)

Loading…
Cancel
Save