diff --git a/pirate-get.py b/pirate-get.py index ba48126..b5c66e7 100755 --- a/pirate-get.py +++ b/pirate-get.py @@ -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: