From 273e15928da1460d3ad48652a39e59ec5a41c76b Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Fri, 5 Jun 2015 14:52:55 +0200 Subject: [PATCH] piratebay: Use new domain names .se redirects to those. http://torrentfreak.com/pirate-bay-loses-new-domain-name-hydra-lives-on-150522/ Take over maintainership since the previous maintainer isn't active. --- modules/piratebay/browser.py | 15 ++++++++++----- modules/piratebay/module.py | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/piratebay/browser.py b/modules/piratebay/browser.py index 95b6ea5b..df15c4aa 100644 --- a/modules/piratebay/browser.py +++ b/modules/piratebay/browser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2010-2011 Julien Veyssier +# Copyright(C) 2010-2015 Julien Veyssier, Laurent Bachelier # # This file is part of weboob. # @@ -18,23 +18,28 @@ # along with weboob. If not, see . -from urlparse import urlsplit +import random import urllib +from urlparse import urlsplit from weboob.deprecated.browser import Browser, BrowserHTTPNotFound from .pages.index import IndexPage -from .pages.torrents import TorrentsPage, TorrentPage - +from .pages.torrents import TorrentPage, TorrentsPage __all__ = ['PiratebayBrowser'] class PiratebayBrowser(Browser): ENCODING = 'utf-8' + DOMAINS = ['thepiratebay.vg', + 'thepiratebay.la', + 'thepiratebay.am', + 'thepiratebay.mn', + 'thepiratebay.gd'] def __init__(self, url, *args, **kwargs): - url = url or 'https://thepiratebay.se/' + url = url or 'https://%s/' % random.choice(self.DOMAINS) url_parsed = urlsplit(url) self.PROTOCOL = url_parsed.scheme self.DOMAIN = url_parsed.netloc diff --git a/modules/piratebay/module.py b/modules/piratebay/module.py index 9a971223..3be3549e 100644 --- a/modules/piratebay/module.py +++ b/modules/piratebay/module.py @@ -30,8 +30,8 @@ __all__ = ['PiratebayModule'] class PiratebayModule(Module, CapTorrent): NAME = 'piratebay' - MAINTAINER = u'Julien Veyssier' - EMAIL = 'julien.veyssier@aiur.fr' + MAINTAINER = u'Laurent Bachelier' + EMAIL = 'laurent@bachelier.name' VERSION = '1.1' DESCRIPTION = 'The Pirate Bay BitTorrent tracker' LICENSE = 'AGPLv3+'