mirror of https://github.com/paulgb/BarbBlock
add blacklist templates and generation script
parent
b1f94c6cdd
commit
f75d5c4575
@ -1,4 +1,7 @@
|
|||||||
|
|
||||||
|
blacklists/% : src/generate_blacklist.py blacklist.json templates/%.tmpl
|
||||||
|
python $^ $@
|
||||||
|
|
||||||
package :
|
package :
|
||||||
cd extension; zip barbblock.zip -r ./ -x *.git*
|
cd extension; zip barbblock.zip -r ./ -x *.git*
|
||||||
mv extension/barbblock.zip ./
|
mv extension/barbblock.zip ./
|
||||||
|
@ -0,0 +1,161 @@
|
|||||||
|
{
|
||||||
|
"name": "BarbBlock",
|
||||||
|
"version": "1.1",
|
||||||
|
"description": "Blocks requests to sites which have used legal threats to remove themselves from other blacklists.",
|
||||||
|
"last_update": "2017-08-13",
|
||||||
|
"url_base": "https://ssl.bblck.me/blacklists",
|
||||||
|
"page_url": "https://ssl.bblck.me/",
|
||||||
|
|
||||||
|
"blacklist": [
|
||||||
|
{
|
||||||
|
"issues": [1],
|
||||||
|
"takedown": "https://github.com/github/dmca/blob/master/2017/2017-08-02-LevenLabs.md",
|
||||||
|
"domains": [
|
||||||
|
"functionalclam.com"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"issues": [8],
|
||||||
|
"domains": [
|
||||||
|
"2znp09oa.com",
|
||||||
|
"4jnzhl0d0.com",
|
||||||
|
"6ldu6qa.com",
|
||||||
|
"82o9v830.com",
|
||||||
|
"abandonedclover.com",
|
||||||
|
"abruptroad.com",
|
||||||
|
"actuallysheep.com",
|
||||||
|
"ak0gsh40.com",
|
||||||
|
"ambitiousagreement.com",
|
||||||
|
"anxiousapples.com",
|
||||||
|
"argyresthia.com",
|
||||||
|
"awzbijw.com",
|
||||||
|
"balloontexture.com",
|
||||||
|
"baskettexture.com",
|
||||||
|
"bawdybeast.com",
|
||||||
|
"beamincrease.com",
|
||||||
|
"beamkite.com",
|
||||||
|
"boilingbeetle.com",
|
||||||
|
"boredcrown.com",
|
||||||
|
"brassrule.com",
|
||||||
|
"broadboundary.com",
|
||||||
|
"broadcastbed.com",
|
||||||
|
"calmfoot.com",
|
||||||
|
"cherrythread.com",
|
||||||
|
"chiefcurrent.com",
|
||||||
|
"chinchickens.com",
|
||||||
|
"comfortablecheese.com",
|
||||||
|
"commandwalk.com",
|
||||||
|
"concernrain.com",
|
||||||
|
"consciouscabbage.com",
|
||||||
|
"copperchickens.com",
|
||||||
|
"copycarpenter.com",
|
||||||
|
"copyrightaccesscontrols.com",
|
||||||
|
"crawlclocks.com",
|
||||||
|
"critictruck.com",
|
||||||
|
"crownclam.com",
|
||||||
|
"curtaincows.com",
|
||||||
|
"cutecushion.com",
|
||||||
|
"decisiveducks.com",
|
||||||
|
"delightdriving.com",
|
||||||
|
"differentdesk.com",
|
||||||
|
"dk4ywix.com",
|
||||||
|
"docksalmon.com",
|
||||||
|
"doubtfulrainstorm.com",
|
||||||
|
"dragzebra.com",
|
||||||
|
"elasticchange.com",
|
||||||
|
"elephantqueue.com",
|
||||||
|
"exclusivebrass.com",
|
||||||
|
"flavordecision.com",
|
||||||
|
"floodprincipal.com",
|
||||||
|
"functionalclam.com",
|
||||||
|
"futuristicfairies.com",
|
||||||
|
"fuzzyflavor.com",
|
||||||
|
"ga87z2o.com",
|
||||||
|
"giddycoat.com",
|
||||||
|
"gorgeousground.com",
|
||||||
|
"greetzebra.com",
|
||||||
|
"greyinstrument.com",
|
||||||
|
"guardedgovernor.com",
|
||||||
|
"guitarbelieve.com",
|
||||||
|
"h78xb.pw",
|
||||||
|
"hfc195b.com",
|
||||||
|
"hilariouszinc.com",
|
||||||
|
"illustriousoatmeal.com",
|
||||||
|
"incrediblesugar.com",
|
||||||
|
"ivykiosk.com",
|
||||||
|
"j93557g.com",
|
||||||
|
"jewelcheese.com",
|
||||||
|
"karisimbi.net",
|
||||||
|
"limpingline.com",
|
||||||
|
"lizardslaugh.com",
|
||||||
|
"lopsidedspoon.com",
|
||||||
|
"loudloss.com",
|
||||||
|
"lp3tdqle.com",
|
||||||
|
"lumpyleaf.com",
|
||||||
|
"matchcows.com",
|
||||||
|
"messagenovice.com",
|
||||||
|
"mixedreading.com",
|
||||||
|
"mowfruit.com",
|
||||||
|
"ovalpigs.com",
|
||||||
|
"peacepowder.com",
|
||||||
|
"photographpan.com",
|
||||||
|
"pietexture.com",
|
||||||
|
"possibleboats.com",
|
||||||
|
"practicetoothpaste.com",
|
||||||
|
"presetrabbits.com",
|
||||||
|
"profitrumour.com",
|
||||||
|
"provideplant.com",
|
||||||
|
"quaintcan.com",
|
||||||
|
"quicksandear.com",
|
||||||
|
"readgoldfish.com",
|
||||||
|
"rebelsubway.com",
|
||||||
|
"receptiveink.com",
|
||||||
|
"resolutekey.com",
|
||||||
|
"rulerabbit.com",
|
||||||
|
"saysidewalk.com",
|
||||||
|
"scarcestream.com",
|
||||||
|
"scrubsky.com",
|
||||||
|
"scrubswim.com",
|
||||||
|
"separatesilver.com",
|
||||||
|
"shakesea.com",
|
||||||
|
"shakytaste.com",
|
||||||
|
"shallowschool.com",
|
||||||
|
"shelterstraw.com",
|
||||||
|
"shiveringsail.com",
|
||||||
|
"shockingswing.com",
|
||||||
|
"simplisticnose.com",
|
||||||
|
"sinceresofa.com",
|
||||||
|
"snakesort.com",
|
||||||
|
"sneaklevel.com",
|
||||||
|
"sneakystamp.com",
|
||||||
|
"spectacularsnail.com",
|
||||||
|
"spillvacation.com",
|
||||||
|
"squeamishscarecrow.com",
|
||||||
|
"storesurprise.com",
|
||||||
|
"stormyachiever.com",
|
||||||
|
"stormyshock.com",
|
||||||
|
"stormysponge.com",
|
||||||
|
"straightnest.com",
|
||||||
|
"strivesidewalk.com",
|
||||||
|
"structuresofa.com",
|
||||||
|
"succeedscene.com",
|
||||||
|
"superficialsink.com",
|
||||||
|
"terribleturkey.com",
|
||||||
|
"thirdrespect.com",
|
||||||
|
"throattrees.com",
|
||||||
|
"tidytrail.com",
|
||||||
|
"tracedesire.com",
|
||||||
|
"trickycelery.com",
|
||||||
|
"tritetongue.com",
|
||||||
|
"truckstomatoes.com",
|
||||||
|
"unknowntray.com",
|
||||||
|
"unusualtitle.com",
|
||||||
|
"voicevegetable.com",
|
||||||
|
"wateryvan.com",
|
||||||
|
"wirecomic.com",
|
||||||
|
"xovq5nemr.com",
|
||||||
|
"zbwp6ghm.com"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
|
||||||
|
import jinja2
|
||||||
|
|
||||||
|
|
||||||
|
def run_template_engine(blacklist_file, template_file, output_file):
|
||||||
|
template_path, template_file = os.path.split(template_file)
|
||||||
|
|
||||||
|
with open(blacklist_file) as bf:
|
||||||
|
context = json.load(bf)
|
||||||
|
|
||||||
|
result = jinja2.Environment(
|
||||||
|
loader=jinja2.FileSystemLoader(template_path or './')
|
||||||
|
).get_template(template_file).render(context)
|
||||||
|
|
||||||
|
with open(output_file, 'w') as of:
|
||||||
|
of.write(result)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('blacklist')
|
||||||
|
parser.add_argument('template')
|
||||||
|
parser.add_argument('outfile')
|
||||||
|
args = parser.parse_args()
|
||||||
|
run_template_engine(args.blacklist, args.template, args.outfile)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
@ -0,0 +1,10 @@
|
|||||||
|
[Adblock Plus 2.0]
|
||||||
|
! Version: {{ version }}
|
||||||
|
! Title: {{ name }}
|
||||||
|
! Last modified: {{ last_update }}
|
||||||
|
! Expires: 1 days
|
||||||
|
! Homepage: {{ page_url }}{% for blockset in blacklist %}
|
||||||
|
! ============== Site group {{loop.index}} =============={% for issue in blockset.issues %}
|
||||||
|
! GitHub Issue: https://github.com/paulgb/BarbBlock/issues/{{ issue }}{% endfor %}{% if blockset.takedown %}
|
||||||
|
! Takedown URL: {{ blockset.takedown }}{% endif %}{% for domain in blockset.domains %}
|
||||||
|
||{{ domain }}^{% endfor %}{% endfor %}
|
@ -0,0 +1,12 @@
|
|||||||
|
# {{ name }}
|
||||||
|
# Version: {{ version }}
|
||||||
|
# Last Update: {{ last_update }}
|
||||||
|
# Homepage: {{ page_url }}
|
||||||
|
# Canonical URL for this file: {{ url_base }}/hosts-file.txt
|
||||||
|
{% for blockset in blacklist %}
|
||||||
|
# ============== Site group {{loop.index}} =============={% for issue in blockset.issues %}
|
||||||
|
# GitHub Issue: https://github.com/paulgb/BarbBlock/issues/{{ issue }}{% endfor %}{% if blockset.takedown %}
|
||||||
|
# Takedown URL: {{ blockset.takedown }}{% endif %}
|
||||||
|
{% for domain in blockset.domains %}
|
||||||
|
0.0.0.0 {{ domain }}{% endfor %}
|
||||||
|
{% endfor %}
|
@ -0,0 +1,8 @@
|
|||||||
|
! Title: {{ name }}
|
||||||
|
! Homepage: {{ page_url }}
|
||||||
|
! {{ description }}
|
||||||
|
{% for blockset in blacklist %}! ============== Site group {{loop.index}} =============={% for issue in blockset.issues %}
|
||||||
|
! GitHub Issue: https://github.com/paulgb/BarbBlock/issues/{{ issue }}{% endfor %}{% if blockset.takedown %}
|
||||||
|
! Takedown URL: {{ blockset.takedown }}{% endif %}{% for domain in blockset.domains %}
|
||||||
|
||{{ domain }}{% endfor %}
|
||||||
|
{% endfor %}
|
Loading…
Reference in New Issue