1
0
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:
rnhmjoj 2015-08-31 02:26:18 +00:00
parent 03bf5e618f
commit dac8702751
3 changed files with 6 additions and 4 deletions

View File

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

View File

@ -0,0 +1,3 @@
[
"https://thebay.tv"
]

View File

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