mirror of
https://github.com/DandelionSprout/adfilt.git
synced 2026-10-06 08:54:53 +01:00
Add files via upload
This commit is contained in:
@@ -4429,7 +4429,7 @@ wellness.se#?#article:-abp-has(.ad)
|
||||
! /\/\/\/\/\/\/\/\/\/\ Manuella fixor tillagt av Adblock Plus-teamet / Manual fixes added by the Adblock Plus team /\/\/\/\/\/\/\/\/\/\
|
||||
! (Currently empty.)
|
||||
|
||||
! Version: 30520222
|
||||
! Version: 40520221
|
||||
! Title: Adblock List for Finland
|
||||
! Description: Finnish adblock list
|
||||
! Expires: 4 days
|
||||
@@ -4709,6 +4709,7 @@ fuengirola.fi#?#.elementor-widget-divider.elementor-widget.elementor-widget-divi
|
||||
fuengirola.fi,mesta.net,paakallo.fi,puheenaiheet.fi##.gofollow
|
||||
funtampere.fi##.banner_container
|
||||
futisfani.com,kiekkofani.com,penkkiurheilu.com,uutisankka.com##[class^=top-banner-]
|
||||
futisfani.com,kiekkofani.com,penkkiurheilu.com,uutisankka.com##[data-advadstrackid]
|
||||
futisfani.com,kiekkofani.com,penkkiurheilu.com,uutisankka.com##.mvp-side-widget.widget_text
|
||||
gamereactor.fi###adContainer
|
||||
gamereactor.fi###ad_topScroller
|
||||
|
||||
@@ -6384,4 +6384,128 @@ if __name__ == "__main__":
|
||||
with open(OUTPUT_DOMAINS, "w") as text_file:
|
||||
text_file.write(domains_filter)
|
||||
|
||||
print('The combined IP list has been generated.')
|
||||
print('The combined IP list has been generated.')
|
||||
|
||||
#/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\/•\
|
||||
#•X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X••X•
|
||||
#\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/\•/
|
||||
|
||||
import requests
|
||||
import re
|
||||
|
||||
SOURCES = ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Sensitive%20lists/Twitter%20De-Politificator.txt']
|
||||
|
||||
OUTPUT = 'Domeneversjoner/xyzzyxnitter.txt'
|
||||
OUTPUT_DOMAINS = 'Domeneversjoner/Nitter De-Politificator.txt'
|
||||
|
||||
# function that downloads the filter list
|
||||
def download_filters() -> str:
|
||||
text = ''
|
||||
for url in SOURCES:
|
||||
r = requests.get(url)
|
||||
text += r.text
|
||||
return text
|
||||
|
||||
# function that prepares the filter list for AdGuard Home
|
||||
def prepare_domains(lines) -> str:
|
||||
text = ''
|
||||
|
||||
previous_line = None
|
||||
|
||||
for line in lines:
|
||||
|
||||
if line == previous_line:
|
||||
continue
|
||||
|
||||
line = re.sub(
|
||||
r"^twitter\.com,twitter3e4tixl4xyajtrzo62zg5vztmjuricljdp2c5kshju4avyoid\.onion#\?#article",
|
||||
r"nitter.net,nitter.42l.fr#?#.timeline-item",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r"🕊 Twitter and Mastodon De-Politificator",
|
||||
r"🌂 Twitter De-Politificator - Nitter Supplement",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r"^! 📛 .*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r"^mas.*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r"^[*#].*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r".*position: absolute; .*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r".*astodon.*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r".* flag[ ,].*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r"^!!!.*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r".*united species.*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r".*constructive meme.*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
line = re.sub(
|
||||
r".*prohibitions on .*",
|
||||
r"",
|
||||
line
|
||||
)
|
||||
|
||||
if not line == '':
|
||||
text += line + '\r\n'
|
||||
|
||||
return text
|
||||
|
||||
if __name__ == "__main__":
|
||||
print('Starting the script')
|
||||
text = download_filters()
|
||||
lines = text.splitlines(False)
|
||||
print('Total number of rules: ' + str(len(lines)))
|
||||
|
||||
domains_filter = prepare_domains(lines)
|
||||
|
||||
with open(OUTPUT, "w") as text_file:
|
||||
text_file.write(text)
|
||||
|
||||
with open(OUTPUT_DOMAINS, "w") as text_file:
|
||||
text_file.write(domains_filter)
|
||||
|
||||
print('The Nitter list version has been generated.')
|
||||
Reference in New Issue
Block a user