mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-09 09:59:51 +01:00
Use a scalable blacklist
This commit is contained in:
parent
03bf5e618f
commit
dac8702751
@ -5,9 +5,9 @@ import pkgutil
|
||||
def get_resource(filename):
|
||||
return pkgutil.get_data(__package__, 'data/' + filename)
|
||||
|
||||
|
||||
categories = json.loads(get_resource('categories.json').decode())
|
||||
sorts = json.loads(get_resource('sorts.json').decode())
|
||||
blacklist = set(json.loads(get_resource('blacklist.json').decode()))
|
||||
|
||||
default_headers = {'User-Agent': 'pirate get'}
|
||||
default_timeout = 10
|
||||
|
3
pirate/data/blacklist.json
Normal file
3
pirate/data/blacklist.json
Normal file
@ -0,0 +1,3 @@
|
||||
[
|
||||
"https://thebay.tv"
|
||||
]
|
@ -176,9 +176,8 @@ def main():
|
||||
if f.getcode() != 200:
|
||||
raise IOError('The proxy bay responded with an error.')
|
||||
mirrors = mirrors.union([i.decode('utf-8').strip()
|
||||
for i in f.readlines()][3:])
|
||||
# This mirror messes up links in the search results page - you need to load a second page to get the magnet link
|
||||
mirrors.discard('https://thebay.tv')
|
||||
for i in f.readlines()][3:]
|
||||
).difference(pirate.data.blacklist)
|
||||
|
||||
for mirror in mirrors:
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user