1
0
mirror of https://github.com/minoplhy/filters-maker.git synced 2024-12-22 18:18:13 +00:00

Hype Hype

This commit is contained in:
minoplhy 2021-08-02 18:50:11 +07:00
parent 11bc15614d
commit 81c343223e
6 changed files with 36 additions and 6 deletions

25
action.py Normal file
View File

@ -0,0 +1,25 @@
import sys
sys.path.append('/filters-maker/')
import crawler
import maker_rpz
import maker_domains
input = '/repros/$INPUT_DESTINATION_FOLDER/$INPUT_DESTINATION_VERSION/domains.txt'
excluded = '/repros/Resources/excluded.txt'
rpz_locat = '/repros/$INPUT_DESTINATION_FOLDER/$INPUT_DESTINATION_VERSION/rpz.txt'
crawler.download_filters("https://dbl.oisd.nl/" ,input)
crawler.download_filters("https://hosts.netlify.app/Pro/rpz.txt" ,input)
crawler.download_filters("https://filters.kylz.nl/RPZ/adguard/dns.txt" ,input)
crawler.download_filters("https://filters.kylz.nl/RPZ/adguard/cname-tracker.txt" ,input)
crawler.download_filters("https://filters.kylz.nl/RPZ/adguard/cname-original.txt" ,input)
crawler.download_filters("https://filters.kylz.nl/RPZ/stevenblack/f-s.txt" ,input)
crawler.download_filters("https://filters.kylz.nl/RPZ/someonewhocares/rpz.txt" ,input)
crawler.download_filters("https://urlhaus.abuse.ch/downloads/rpz/" ,input)
crawler.download_filters("https://github.com/easylist/easylist/raw/master/easylist/easylist_adservers.txt" ,input)
crawler.filtering(input)
crawler.filteringcon(input)
crawler.killingdup(input)
maker_rpz.RPZbuilding(excluded, input, rpz_locat)
maker_domains.domainsbuilding(excluded, input)

View File

@ -20,6 +20,9 @@ inputs:
Destination_VERSION:
description: "version"
required: true
ACTION_NAME:
description: 'action script'
required: true
GIT_NAME:
description: 'username'
required: true
@ -39,6 +42,7 @@ runs:
- ${{ inputs.Destination_REPO }}
- ${{ inputs.Destination_FOLDER }}
- ${{ inputs.Destination_VERSION }}
- ${{ inputs.ACTION_FILE }}
- ${{ inputs.GIT_NAME }}
- ${{ inputs.GIT_EMAIL }}
- ${{ inputs.REPO_BRANCH }}

View File

@ -12,7 +12,12 @@ try:
except OSError:
pass
def download_filters(url):
def download_filters(url,input):
try:
os.remove(input)
except OSError:
pass
print("downloading: ",url)
get = requests.get(url)

View File

@ -3,10 +3,8 @@ git clone https://github.com/minoplhy/filters-maker /filters-maker
git clone https://x-access-token:$API_TOKEN_GITHUB@github.com/$INPUT_DESTINATION_UNAME/$INPUT_DESTINATION_REPO.git /repros
mkdir /repros/$INPUT_DESTINATION_FOLDER/$INPUT_DESTINATION_VERSION
pip3 install -r /filters-maker/requirements.txt
python3 /filters-maker/crawler.py /repros/$INPUT_DESTINATION_FOLDER/$INPUT_DESTINATION_VERSION/domains.txt
python3 /filters-maker/maker-rpz.py /repros/Resources/excluded.txt /repros/$INPUT_DESTINATION_FOLDER/$INPUT_DESTINATION_VERSION/domains.txt /repros/$INPUT_DESTINATION_FOLDER/$INPUT_DESTINATION_VERSION/rpz.txt
python3 /filters-maker/maker-domains.py /repros/Resources/excluded.txt /repros/$INPUT_DESTINATION_FOLDER/$INPUT_DESTINATION_VERSION/domains.txt
cd /repros
python3 /repros/$INPUT_ACTION_FILE
git config --local user.name $INPUT_GIT_NAME
git config --local user.email $INPUT_GIT_EMAIL
git add .

View File

@ -40,6 +40,4 @@ def RPZbuilding():
if not line.strip():
f.write('\n'.join([line + '\n']))
f.close()
RPZbuilding()
exit()