mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-10 10:04:21 +01:00
Fix proxy bay 403 error
Cloudflare was banning pirate-get for not having a user agent.
This commit is contained in:
parent
6554bdf4d5
commit
d094a973a6
@ -41,7 +41,6 @@ colored_output = True
|
||||
|
||||
default_timeout = 10
|
||||
|
||||
headers = {'User-Agent': 'pirate get'}
|
||||
default_headers = {'User-Agent': 'pirate get'}
|
||||
|
||||
categories = {
|
||||
@ -107,13 +106,6 @@ sorts = {
|
||||
'Default': 99}
|
||||
|
||||
|
||||
class NoRedirection(request.HTTPErrorProcessor):
|
||||
def http_response(self, _, res):
|
||||
return res
|
||||
|
||||
https_response = http_response
|
||||
|
||||
|
||||
# create a subclass and override the handler methods
|
||||
class BayParser(HTMLParser):
|
||||
title = ''
|
||||
@ -556,9 +548,9 @@ def main():
|
||||
else:
|
||||
mags, mirrors = [], {'https://thepiratebay.se'}
|
||||
try:
|
||||
opener = request.build_opener(NoRedirection)
|
||||
f = opener.open('https://proxybay.info/list.txt',
|
||||
timeout=default_timeout)
|
||||
req = request.Request('https://proxybay.co/list.txt',
|
||||
headers=default_headers)
|
||||
f = request.urlopen(req, timeout=default_timeout)
|
||||
except IOError:
|
||||
print('Could not fetch additional mirrors', color='WARN')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user