Skip to content

Commit

Permalink
Import dnsmasq-china-list
Browse files Browse the repository at this point in the history
  • Loading branch information
xkww3n committed Jan 3, 2024
1 parent 45ee8f3 commit 83e2c91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- [乘风广告过滤规则](https://github.com/xinggsf/Adblock-Plus-Rule/)
- [d3Host List by d3ward](https://github.com/d3ward/toolz/blob/master/src/d3host.adblock)
- [Domain list community](https://github.com/v2fly/domain-list-community)
- [dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list)
- [chnroutes2 (better-aggregated chnroutes)](https://github.com/misakaio/chnroutes2/)
- [aggregate6](https://github.com/job/aggregate6)
- [python-abp](https://hg.adblockplus.org/python-abp/)
Expand Down
6 changes: 6 additions & 0 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@
if any([item.Payload.endswith(os_tld) for os_tld in tld_overseas]):
ruleset_domestic.remove(item)
logger.debug(f"{item} removed for having a overseas TLD.")

# Import dnsmasq-china-list
raw = connection.get("https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf").text
for line in raw.replace("server=/", "").replace("/114.114.114.114", "").splitlines():
ruleset_domestic.add(rule.Rule("DomainFull", line))

ruleset_domestic = ruleset.patch(ruleset_domestic, "domestic")

# Add all domestic TLDs to domestic rules, then perform deduplication.
Expand Down

0 comments on commit 83e2c91

Please sign in to comment.