diff --git a/.github/workflows/tw165.yml b/.github/workflows/tw165.yml index d3939e7..37853a0 100644 --- a/.github/workflows/tw165.yml +++ b/.github/workflows/tw165.yml @@ -25,7 +25,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} push-branch: 'master' commit-message: '🤖 自動更新 165 詐騙網址' - files: TW165.txt TW165-redirect.txt + files: TW165_adb.txt TW165-redirect.txt name: tdc email: tdc@sudo.host diff --git a/.github/workflows/twnic_rpz.yml b/.github/workflows/twnic_rpz.yml index d81bfc6..ef02bd2 100644 --- a/.github/workflows/twnic_rpz.yml +++ b/.github/workflows/twnic_rpz.yml @@ -21,6 +21,6 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} push-branch: 'master' commit-message: '🤖 自動更新 TWNIC RPZ 封鎖域名' - files: TWNIC-RPZ.txt + files: TWNIC-RPZ_adb.txt name: tdc email: tdc@sudo.host diff --git a/AutoBuild/builder.py b/AutoBuild/builder.py index 79eba41..36c37b3 100644 --- a/AutoBuild/builder.py +++ b/AutoBuild/builder.py @@ -5,7 +5,7 @@ import requests filterlist = { 'abp': ['experimental.txt', 'filter.txt', 'PureView/news.txt', 'PureView/news_mobile.txt'], - 'hosts': ['hosts.txt', 'nofarm_hosts.txt', 'TW165.txt', 'TWNIC-RPZ.txt'] + 'hosts': ['hosts_adb.txt', 'nofarm_adb.txt', 'TW165_adb.txt', 'TWNIC-RPZ_adb.txt'] } url = 'https://filter.futa.gg/' tz = timezone(timedelta(hours=+8)) @@ -20,7 +20,7 @@ class HEAD: '! Homepage: https://t.me/AdBlock_TW\n' \ '! ----------------------------------------------------------------------\n' hosts: str = '! FutaHosts\n' \ - '! LowTechFilter {name}\n' \ + '! Title: LowTechFilter {name}\n' \ '! URL: \n' \ '! Version: {version}\n' \ '! --------------------------------------------------\n' @@ -63,7 +63,7 @@ for category in filterlist: ### SP ### # hide farm site from google - if filename == 'nofarm_hosts.txt': + if filename == 'nofarm_adb.txt': domain_list = '' for domains in data.splitlines(): if not domains.startswith('!'): @@ -84,20 +84,10 @@ for category in filterlist: data = data.splitlines() newdata = '\n'.join(data) name = filename.split('.txt')[0] - with open(name+'-domains.txt', 'w') as output: + with open(name+'_domains.txt', 'w') as output: pattern = r'(?<=^\|\|)\S+\.\S{2,}(?=\^)' newoutput = '\n'.join(re.findall(pattern, newdata, re.MULTILINE)) print(newoutput) output.write(newoutput) - if filename in ['TW165.txt', 'hosts.txt', 'TWNIC-RPZ.txt']: + if filename in ['TW165_adb.txt', 'hosts_adb.txt', 'TWNIC-RPZ_adb.txt']: to_pure_domain(filename, data) - - # if filename == 'hosts.txt': - # data = data.splitlines() - # newdata = '\n'.join(data[5:]) - # desc = '\n'.join(x.replace('!', '#') for x in data[:5]) + '\n' - - # with open('domains.txt', 'w') as output: - # pattern = r'(?<=^\|\|)\S+\.\S{2,}(?=\^)' - # desc += '\n'.join(re.findall(pattern, newdata, re.MULTILINE)) - # output.write(desc) \ No newline at end of file diff --git a/AutoBuild/pure_domain.py b/AutoBuild/pure_domain.py index e816ad5..ee95184 100644 --- a/AutoBuild/pure_domain.py +++ b/AutoBuild/pure_domain.py @@ -1,11 +1,11 @@ import re -with open('../hosts.txt', 'r') as files: +with open('../hosts_adb.txt', 'r') as files: data = files.read().splitlines() newdata = '\n'.join(data[5:]) desc = '\n'.join(x.replace('!', '#') for x in data[:5]) + '\n' - with open('../domains.txt', 'w') as output: + with open('../domains_adb.txt', 'w') as output: pattern = r'(?<=^\|\|)\S+\.\S{2,}(?=\^)' desc += '\n'.join(re.findall(pattern, newdata, re.MULTILINE)) output.write(desc) diff --git a/AutoBuild/tw_165.py b/AutoBuild/tw_165.py index 481f879..e74d82c 100644 --- a/AutoBuild/tw_165.py +++ b/AutoBuild/tw_165.py @@ -70,7 +70,7 @@ def main(): and not exclude_list(k)} - filename = 'TW165.txt' + filename = 'TW165_adb.txt' with open(filename, 'w') as f: f.write(''.join(f'||{e}^\n' for e in domains.keys())) diff --git a/AutoBuild/twnic_rpz.py b/AutoBuild/twnic_rpz.py index d6914fa..ed0d1ee 100644 --- a/AutoBuild/twnic_rpz.py +++ b/AutoBuild/twnic_rpz.py @@ -24,7 +24,7 @@ def main(): sys.exit(1) output = [domain for in_dic in parse_data for domain in in_dic['domains']] - with open('TWNIC-RPZ.txt', 'w') as f: + with open('TWNIC-RPZ_adb.txt', 'w') as f: f.write(''.join(f'||{e}^\n' for e in output)) diff --git a/TW165.txt b/TW165_adb.txt similarity index 100% rename from TW165.txt rename to TW165_adb.txt diff --git a/TWNIC-RPZ.txt b/TWNIC-RPZ_adb.txt similarity index 91% rename from TWNIC-RPZ.txt rename to TWNIC-RPZ_adb.txt index ea05e81..8992806 100644 --- a/TWNIC-RPZ.txt +++ b/TWNIC-RPZ_adb.txt @@ -1,3 +1,8 @@ +! FutaHosts +! Title: LowTechFilter Twnic-Rpz Adb +! URL: +! Version: 2024.0220.1 +! -------------------------------------------------- ||gimy.tv^ ||gimy.co^ ||gimy.to^ diff --git a/hosts.txt b/hosts_adb.txt similarity index 100% rename from hosts.txt rename to hosts_adb.txt diff --git a/nofarm_hosts.txt b/nofarm_adb.txt similarity index 100% rename from nofarm_hosts.txt rename to nofarm_adb.txt