Skip to content

Commit

Permalink
Update script
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdargon committed Nov 1, 2019
1 parent 430dcee commit 4da4718
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 53 deletions.
2 changes: 1 addition & 1 deletion filters/adservers-all.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Title: hostsVN
! Last modified: 01 Nov 2019 22:38 UTC+7
! Last modified: 01 Nov 2019 22:47 UTC+7
! Blocked: 5,709 rules
! The section containing the list contains all ad networks and tracking
!
Expand Down
2 changes: 1 addition & 1 deletion filters/adservers.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Title: hostsVN
! Last modified: 01 Nov 2019 22:38 UTC+7
! Last modified: 01 Nov 2019 22:47 UTC+7
! Blocked: 267 rules
! The section contains a list of advertising and tracking networks in Vietnam
!
Expand Down
2 changes: 1 addition & 1 deletion filters/domain-adservers-all.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Title: hostsVN
! Last modified: 01 Nov 2019 22:38 UTC+7
! Last modified: 01 Nov 2019 22:47 UTC+7
! Blocked: 5,709 rules
! The section containing the list contains all ad networks and tracking
!
Expand Down
2 changes: 1 addition & 1 deletion hosts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Title: hostsVN
# Last modified: 01 Nov 2019 22:38 UTC+7
# Last modified: 01 Nov 2019 22:47 UTC+7
# Blocked: 18,766 domains
# Please report any ads or problems by github
# Home: https://bigdargon.github.io/hostsVN/
Expand Down
8 changes: 4 additions & 4 deletions makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ cat tmp/adservers.tmp tmp/adservers-all.tmp | awk '{print "DOMAIN-SUFFIX,"$1}' >

# create rewrite
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print $1}' > option/hostsVN-quantumult-rejection.conf
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print $1" - reject"}' >> tmp/rewrite-surge.tmp
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print $1" url reject-img"}' >> tmp/rewrite-quantumultX.tmp
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print $1" - reject"}' > tmp/rewrite-surge.tmp
cat source/config-rewrite.txt | grep -v '#' | grep -v -e '^[[:space:]]*$' | awk '{print $1" url reject-img"}' > option/hostsVN-quantumultX-rewrite.conf

# create config
HOSTNAME=$(cat source/config-hostname.txt)
sed -e "s/!_hostname_/$HOSTNAME/g" -e '/!_rewrite_surge_/r tmp/rewrite-surge.tmp' -e '/!_rewrite_surge_/d' tmp/title-config-surge.txt > tmp/title-config-surge.tmp
sed -e "s/!_hostname_/$HOSTNAME/g" -e '/!_rewrite_quantumultX_/r tmp/rewrite-quantumultX.tmp' -e '/!_rewrite_quantumultX_/d' tmp/title-config-quantumultX.txt > option/hostsVN-quantumultX.conf
sed -e "s/!_hostname_/$HOSTNAME/g" tmp/title-config-quantumultX.txt > option/hostsVN-quantumultX.conf
sed -e "s/!_hostname_/$HOSTNAME/g" -e '/!_rejection_quantumult_/r option/hostsVN-quantumult-rejection.conf' -e '/!_rejection_quantumult_/d' -e '/!_rule_quantumult_/r option/hostsVN-quantumult-rule.conf' -e '/!_rule_quantumult_/d' tmp/title-config-quantumult.txt > option/hostsVN-quantumult.conf
sed -e "s/!_hostname_/$HOSTNAME/g" -e '/!_rewrite_surge_/r tmp/rewrite-surge.tmp' -e '/!_rewrite_surge_/d' tmp/title-config-surge.txt > tmp/title-config-surge.tmp


echo "Adding to file..."
Expand Down
2 changes: 1 addition & 1 deletion option/hosts-VN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Title: hostsVN
# Last modified: 01 Nov 2019 22:38 UTC+7
# Last modified: 01 Nov 2019 22:47 UTC+7
# Blocked: 1,120 domains
# Only include advertisers in Vietnam
# Home: https://bigdargon.github.io/hostsVN/
Expand Down
2 changes: 1 addition & 1 deletion option/hosts-iOS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Title: hostsVN
# Last modified: 01 Nov 2019 22:38 UTC+7
# Last modified: 01 Nov 2019 22:47 UTC+7
# Blocked: 18,766 domains
# Minimal version for iOS. Please report any ads or problems by github
# Home: https://bigdargon.github.io/hostsVN/
Expand Down
43 changes: 43 additions & 0 deletions option/hostsVN-quantumultX-rewrite.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
^https?:\/\/(\w+\.)?(ads|adserver|uniad|ad-|pagead|adformat|log\w?|tj|tongji|analysis|stat|stats|statis|trace|track|tracking|click)\.\w+\.(com|cn|org|info|io|net|vn) url reject-img
^http?:https://ocsp.apple.com/* url reject-img
^https?:https://graph.facebook.com/network_ads_common/* url reject-img
^https?:https://graph.facebook.com/.+activities url reject-img
^https?:https://graph.facebook.com/.+advertiser_id=* url reject-img
^https?:https://www.facebook.com/adnw_logging/* url reject-img
^https?:https://graph.nhaccuatui.com/.+advs/* url reject-img
^https?:https://graph.nhaccuatui.com/.+logs/* url reject-img
^https?:https://graph.nhaccuatui.com/.+3g-get-info url reject-img
^https?:https://graph.nhaccuatui.com/.+deviceinfo url reject-img
^https?:https://graph.nhaccuatui.com/.+notify-firebase url reject-img
^https?:https://avatar-nct.nixcdn.com/.+popup url reject-img
^https?:https://spclient.wg.spotify.com/ad-logic/* url reject-img
^https?:https://spclient.wg.spotify.com/ads/* url reject-img
^https?:https://spclient.wg.spotify.com/.+ad_slot url reject-img
^https?:https://spclient.wg.spotify.com/.+banners url reject-img
^https?:https://spclient.wg.spotify.com/.+canvases url reject-img
^https?:https://spclient.wg.spotify.com/.+crashlytics url reject-img
^https?:https://spclient.wg.spotify.com/.+doubleclick.net url reject-img
^https?:https://spclient.wg.spotify.com/.+enabled-tracks url reject-img
^https?:https://spclient.wg.spotify.com/.+event url reject-img
^https?:https://spclient.wg.spotify.com/.+promoted_offer url reject-img
^https?:\/\/.+\.googlevideo\.com\/.+&oad url reject-img
^https?:\/\/.+\.googlevideo\.com\/.+&owc url reject-img
!^https?:\/\/.+\.googlevideo\.com\/.+ctier url reject-img
^https?:\/\/.+\.googlevideo\.com\/ptracking\?pltype=adhost url reject-img
^https?:\/\/.+\.googlevideo\.com\/videogoodput\? url reject-img
^https?:\/\/.+\.youtube\.com\/.+get_ads url reject-img
^https?:\/\/.+\.youtube\.com\/api\/stats\/.+adformat url reject-img
^https?:\/\/.+\.youtube\.com\/api\/stats\/ads url reject-img
^https?:\/\/.+\.youtube\.com\/error_204 url reject-img
^https?:\/\/.+\.youtube\.com\/get_midroll url reject-img
^https?:\/\/.+\.youtube\.com\/pagead\/* url reject-img
^https?:\/\/.+\.youtube\.com\/ptracking\? url reject-img
^https?:\/\/play.googleapis.com/log* url reject-img
^https?:\/\/www.googleapis.com/adsmeasurement/* url reject-img
^https?:\/\/youtubei.googleapis.com/youtubei/.+ad_ url reject-img
^https?:\/\/youtubei.googleapis.com/youtubei/.+log_ url reject-img
^https?:\/\/api\d?\.tiktokv\.com\/api\/ad\/ url reject-img
^https?:\/\/api\d?\.musical\.ly\/api\/ad\/ url reject-img
^https?:https://qos-zdn.zaloapp.com/.+trackqos url reject-img
^https?:https://centralized.zaloapp.com/.+tracking url reject-img
^https?:https://oa.zalo.me/.+campaign=zalo url reject-img
45 changes: 2 additions & 43 deletions option/hostsVN-quantumultX.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ server=8.8.8.8
https://raw.githubusercontent.com/bigdargon/hostsVN/master/option/hostsVN-quantumult-rule.conf, tag=hostsVN, force-policy=reject, enabled=true

[rewrite_remote]
https://raw.githubusercontent.com/bigdargon/hostsVN/master/option/hostsVN-quantumultX-rewrite.conf, tag=hostsVN, enabled=true

[server_local]
shadowsocks=127.0.0.1:80, method=none, password=password, fast-open=false, udp-relay=false, tag=localhost
Expand All @@ -20,49 +21,7 @@ shadowsocks=127.0.0.1:80, method=none, password=password, fast-open=false, udp-r
FINAL,DIRECT

[rewrite_local]
^https?:\/\/(\w+\.)?(ads|adserver|uniad|ad-|pagead|adformat|log\w?|tj|tongji|analysis|stat|stats|statis|trace|track|tracking|click)\.\w+\.(com|cn|org|info|io|net|vn) url reject-img
^http?:https://ocsp.apple.com/* url reject-img
^https?:https://graph.facebook.com/network_ads_common/* url reject-img
^https?:https://graph.facebook.com/.+activities url reject-img
^https?:https://graph.facebook.com/.+advertiser_id=* url reject-img
^https?:https://www.facebook.com/adnw_logging/* url reject-img
^https?:https://graph.nhaccuatui.com/.+advs/* url reject-img
^https?:https://graph.nhaccuatui.com/.+logs/* url reject-img
^https?:https://graph.nhaccuatui.com/.+3g-get-info url reject-img
^https?:https://graph.nhaccuatui.com/.+deviceinfo url reject-img
^https?:https://graph.nhaccuatui.com/.+notify-firebase url reject-img
^https?:https://avatar-nct.nixcdn.com/.+popup url reject-img
^https?:https://spclient.wg.spotify.com/ad-logic/* url reject-img
^https?:https://spclient.wg.spotify.com/ads/* url reject-img
^https?:https://spclient.wg.spotify.com/.+ad_slot url reject-img
^https?:https://spclient.wg.spotify.com/.+banners url reject-img
^https?:https://spclient.wg.spotify.com/.+canvases url reject-img
^https?:https://spclient.wg.spotify.com/.+crashlytics url reject-img
^https?:https://spclient.wg.spotify.com/.+doubleclick.net url reject-img
^https?:https://spclient.wg.spotify.com/.+enabled-tracks url reject-img
^https?:https://spclient.wg.spotify.com/.+event url reject-img
^https?:https://spclient.wg.spotify.com/.+promoted_offer url reject-img
^https?:\/\/.+\.googlevideo\.com\/.+&oad url reject-img
^https?:\/\/.+\.googlevideo\.com\/.+&owc url reject-img
!^https?:\/\/.+\.googlevideo\.com\/.+ctier url reject-img
^https?:\/\/.+\.googlevideo\.com\/ptracking\?pltype=adhost url reject-img
^https?:\/\/.+\.googlevideo\.com\/videogoodput\? url reject-img
^https?:\/\/.+\.youtube\.com\/.+get_ads url reject-img
^https?:\/\/.+\.youtube\.com\/api\/stats\/.+adformat url reject-img
^https?:\/\/.+\.youtube\.com\/api\/stats\/ads url reject-img
^https?:\/\/.+\.youtube\.com\/error_204 url reject-img
^https?:\/\/.+\.youtube\.com\/get_midroll url reject-img
^https?:\/\/.+\.youtube\.com\/pagead\/* url reject-img
^https?:\/\/.+\.youtube\.com\/ptracking\? url reject-img
^https?:\/\/play.googleapis.com/log* url reject-img
^https?:\/\/www.googleapis.com/adsmeasurement/* url reject-img
^https?:\/\/youtubei.googleapis.com/youtubei/.+ad_ url reject-img
^https?:\/\/youtubei.googleapis.com/youtubei/.+log_ url reject-img
^https?:\/\/api\d?\.tiktokv\.com\/api\/ad\/ url reject-img
^https?:\/\/api\d?\.musical\.ly\/api\/ad\/ url reject-img
^https?:https://qos-zdn.zaloapp.com/.+trackqos url reject-img
^https?:https://centralized.zaloapp.com/.+tracking url reject-img
^https?:https://oa.zalo.me/.+campaign=zalo url reject-img
!_rewrite_quantumultX_

[mitm]
passphrase = DD204786
Expand Down
1 change: 1 addition & 0 deletions tmp/title-config-quantumultX.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ server=8.8.8.8
https://raw.githubusercontent.com/bigdargon/hostsVN/master/option/hostsVN-quantumult-rule.conf, tag=hostsVN, force-policy=reject, enabled=true

[rewrite_remote]
https://raw.githubusercontent.com/bigdargon/hostsVN/master/option/hostsVN-quantumultX-rewrite.conf, tag=hostsVN, enabled=true

[server_local]
shadowsocks=127.0.0.1:80, method=none, password=password, fast-open=false, udp-relay=false, tag=localhost
Expand Down

0 comments on commit 4da4718

Please sign in to comment.