Merge branch 'filter-rename'

This commit is contained in:
tdc 2024-02-23 16:44:27 +08:00
commit 6f743ff0cc
11 changed files with 16 additions and 143 deletions

View File

@ -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

View File

@ -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

View File

@ -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: <https://github.com/FutaGuard/LowTechFilter>\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)

View File

@ -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)

View File

@ -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()))

View File

@ -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))

View File

@ -1,3 +1,8 @@
! FutaHosts
! Title: LowTechFilter Twnic-Rpz Adb
! URL: <https://github.com/FutaGuard/LowTechFilter>
! Version: 2024.0220.1
! --------------------------------------------------
||gimy.tv^
||gimy.co^
||gimy.to^

View File

@ -1,122 +0,0 @@
[Adblock Plus]
! Title: FutaFilter removeparam
! Version: 2021.0407.01
! Expires: 1 hour
! Homepage: https://t.me/adguard_tw
! ----------------------------------------------------------------------
! facebook
$removeparam=/fb_action_ids/i
$removeparam=/fb_action_types/i
$removeparam=/fb_ref/i
$removeparam=/fb_source/i
$removeparam=/fbclid/i,domain=~l.facebook.com
$removeparam=/extid/i
! Google
$removeparam=/gclid/i
$removeparam=/gclsrc/i
! YouTube
||youtube.com^$removeparam=/feature/i|/feature/i|/kw/i|/pbjreload/i
! Yandex
$removeparam=/yclid/i
$removeparam=/_openstat/i
! Adobe
$removeparam=/sc_cid/i
$removeparam=/mkt_tok/i
! sourceforge
||sourceforge.net^$removeparam=/source/i|/position/i
! ettoday redirect
||ettoday.net^$removeparam=/redirect/i
! 104找工作
||104.com.tw^$removeparam=/jobsource/i
$removeparam=/utm_campaign/i
$removeparam=/utm_content/i
$removeparam=/utm_medium/i
$removeparam=/utm_source/i
$removeparam=/utm_term/i
$removeparam=/mc_id/i
$removeparam=/hss_channel/i
$removeparam=/cid_source/i
$removeparam=/cid_medium/i
! remove cid due to cause some problem
! https://t.me/c/1263692896/71702
! $removeparam=/cid/i
$removeparam=/cid_content/i
$removeparam=/action_object_map/i
$removeparam=/action_type_map/i
$removeparam=/action_ref_map/i
$removeparam=/aff_platform/i
$removeparam=/aff_trace_key/i
$removeparam=/btsid/i
$removeparam=/ws_ab_test/i
$removeparam=/trk/i
$removeparam=/trkCampaign/i
! Humble
$removeparam=/hmb_campaign/i
$removeparam=/hmb_medium/i
$removeparam=/hmb_source/i
$removeparam=/spReportId/i
$removeparam=/spJobID/i
$removeparam=/spUserID/i
$removeparam=/spMailingID/i
$removeparam=/s_cid/i
$removeparam=/elqTrackId/i
$removeparam=/elqTrack/i
$removeparam=/assetType/i
$removeparam=/assetId/i
$removeparam=/recipientId/i
$removeparam=/campaignId/i
! whitelist for ruten
@@||ruten.com.tw$removeparam=/campaignId/i
$removeparam=/siteId/i
! whitelist for CHT login issue
@@||cht.com.tw$removeparam=/siteId/i
@@||emome.net$removeparam=/siteId/i
@@||hinet.net$removeparam=/siteId/i
@@||xuite.net$removeparam=/siteId/i
$removeparam=/mc_cid/i
$removeparam=/mc_eid/i
$removeparam=/sc_campaign/i
$removeparam=/sc_channel/i
$removeparam=/sc_content/i
$removeparam=/sc_medium/i
$removeparam=/sc_outcome/i
$removeparam=/sc_geo/i
$removeparam=/sc_country/i
$removeparam=/nr_email_referer/i
$removeparam=/vero_conv/i
$removeparam=/vero_id/i
$removeparam=/mbid/i
$removeparam=/cmpid/i
$removeparam=/campaign_id/i
$removeparam=/Campaign/i
! whitelist for wiki
@@||wikipedia.org$removeparam=/Campaign/i
$removeparam=/gs_l/i
$removeparam=/_hsenc/i
$removeparam=/_hsmi/i
$removeparam=/__hssc/i
$removeparam=/__hstc/i
$removeparam=/hsCtaTracking/i
$removeparam=/tt_medium/i
$removeparam=/tt_content/i
$removeparam=/wt_zmc/i
$removeparam=/ldtag_cl/i