-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.py
113 lines (104 loc) · 5.45 KB
/
action.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import sys
sys.path.append('/filters-maker')
import os
import crawler
import maker
import duplicat
incoming = "/reprwiki/Private-build/ucate/domains.txt"
excluded = "/repros/Resources/excluded.txt"
rpz_locat = "/reprwiki/Private-build/ucate/rpz.txt"
hosts_locat = "/reprwiki/Private-build/ucate/hosts.txt"
abp_locat = "/reprwiki/Private-build/ucate/adblock.txt"
unb_locat = "/reprwiki/Private-build/ucate/unbound.conf"
dnq_locat = "/reprwiki/Private-build/ucate/dnsmasq.conf"
Version = "UCATE"
os.makedirs('/reprwiki/Private-build/ucate',exist_ok=True)
UCATE_SOURCE = [
'https://badmojr.github.io/1Hosts/Pro/rpz.txt',
'https://github.com/minoplhy/filters/releases/download/filters-build/Adguard-dns_rpz.txt',
'https://github.com/minoplhy/filters/releases/download/filters-build/stevenblack-f_rpz.txt',
'https://github.com/minoplhy/filters/releases/download/filters-build/someonewhocares_rpz.txt',
'https://github.com/minoplhy/filters/releases/download/filters-build/hostsVN-all_rpz.txt',
'https://github.com/minoplhy/filters/raw/main/Resources/blocked.txt',
'https://block.energized.pro/basic/formats/filter',
'https://hblock.molinero.dev/hosts_unbound.conf',
'https://github.com/minoplhy/filters/releases/download/filters-build/Adguard-Base_rpz.txt',
'https://github.com/minoplhy/filters/releases/download/filters-build/Adguard-Mobile_rpz.txt',
'https://github.com/yous/YousList/raw/master/youslist.txt',
'https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters.txt',
'https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters-2020.txt',
'https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters-2021.txt',
'https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters-2022.txt'
]
crawler.clear_old_files(incoming)
crawler.download_group_filters(UCATE_SOURCE ,incoming)
crawler.filtering(incoming)
crawler.filteringcon(incoming)
crawler.killingdup(incoming)
crawler.IP_URL_FILTERING(incoming)
crawler.excluded(excluded, incoming)
crawler.blankremover(incoming)
crawler.sort(incoming)
duplicat.add_file(incoming, "/reprwiki/Private-build/ruleset.txt")
UCATEline = maker.linecounter(incoming)
maker.RPZBlocklist(excluded, incoming, rpz_locat ,Version)
maker.HOSTBlocklist(excluded, incoming, hosts_locat ,Version)
maker.ABPBlocklist(excluded, incoming, abp_locat ,Version)
maker.UNBOUNDBlocklist(excluded, incoming, unb_locat ,Version)
maker.DNSMASQBlocklist(excluded, incoming, dnq_locat ,Version)
maker.DOMAINBlocklist(excluded, incoming ,Version)
incoming = "/reprwiki/Private-build/veneto/domains.txt"
excluded = "/repros/Resources/excluded.txt"
rpz_locat = "/reprwiki/Private-build/veneto/rpz.txt"
hosts_locat = "/reprwiki/Private-build/veneto/hosts.txt"
abp_locat = "/reprwiki/Private-build/veneto/adblock.txt"
unb_locat = "/reprwiki/Private-build/veneto/unbound.conf"
dnq_locat = "/reprwiki/Private-build/veneto/dnsmasq.conf"
Version = "VENETO"
os.makedirs('/reprwiki/Private-build/veneto',exist_ok=True)
VENETO_SOURCE = [
'https://blokada.org/mirror/v5/exodusprivacy/standard/hosts.txt',
'https://github.com/crazy-max/WindowsSpyBlocker/raw/master/data/hosts/spy.txt',
'https://energized.pro/extensions/xtreme/formats/rpz.txt',
'https://phishing.army/download/phishing_army_blocklist_extended.txt',
'https://github.com/minoplhy/filters/releases/download/filters-build/Adguard-Tracking_rpz.txt',
'https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt',
'https://github.com/DandelionSprout/adfilt/raw/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareDomains.txt',
'https://github.com/minoplhy/filters/releases/download/filters-build/Adguard-cname-tracker_rpz.txt',
'https://github.com/minoplhy/filters/releases/download/filters-build/Adguard-cname-original_rpz.txt',
'https://urlhaus.abuse.ch/downloads/rpz/',
'https://github.com/uBlockOrigin/uAssets/raw/master/filters/privacy.txt',
'https://github.com/mitchellkrogza/Phishing.Database/raw/master/phishing-domains-ACTIVE.txt'
]
crawler.clear_old_files(incoming)
crawler.download_group_filters(VENETO_SOURCE ,incoming)
crawler.filtering(incoming)
crawler.filteringcon(incoming)
crawler.killingdup(incoming)
crawler.IP_URL_FILTERING(incoming)
crawler.excluded(excluded, incoming)
crawler.blankremover(incoming)
crawler.sort(incoming)
duplicat.check_n_kill_dupes("/reprwiki/Private-build/ruleset.txt", incoming)
duplicat.add_file(incoming, "/reprwiki/Private-build/ruleset.txt")
VENETOline = maker.linecounter(incoming)
maker.RPZBlocklist(excluded, incoming, rpz_locat ,Version)
maker.HOSTBlocklist(excluded, incoming, hosts_locat ,Version)
maker.ABPBlocklist(excluded, incoming, abp_locat ,Version)
maker.UNBOUNDBlocklist(excluded, incoming, unb_locat ,Version)
maker.DNSMASQBlocklist(excluded, incoming, dnq_locat ,Version)
maker.DOMAINBlocklist(excluded, incoming ,Version)
excluded = "/repros/Resources/excluded.txt"
os.makedirs('/reprwiki/Private-build/Allowlist',exist_ok=True)
Version = "Allowlist"
rpz_locat = "/reprwiki/Private-build/Allowlist/rpz.txt"
abp_locat = "/reprwiki/Private-build/Allowlist/adblock.txt"
domains_locat = "/reprwiki/Private-build/Allowlist/domains.txt"
ALLOWLISTline = maker.linecounter(excluded)
maker.RPZAllowlist(excluded, rpz_locat ,Version)
maker.ABPAllowlist(excluded, abp_locat ,Version)
maker.DOMAINAllowlist(excluded ,domains_locat ,Version)
import version
het = "/repros/version.md"
addition = "\n# Rule Counter \n ### UCATE : " + str(UCATEline) +"\n\n ### Veneto : " + str(VENETOline) + "\n\n ### Allowlist : " + str(ALLOWLISTline)
version.build(het, addition)