Beispiel #1
0
    def __init__(self):

        generic.TorrentProvider.__init__(self, 'bB', cache_update_freq=15)

        self.url_base = [
            re.sub(r'(?i)[qx\sz]+', '', x[::-1]) for x in [
                'HaQ', 'c0Rz', 'MH', 'yL6', 'NW Yi9', 'pJmbv', 'Hd', 'buMz',
                'wLn J3', '=xXx='
            ]
        ]
        self.url_base = b64decodestring(''.join(self.url_base))
        self.urls = {
            'config_provider_home_uri': self.url_base,
            'login_action': self.url_base + 'login.php',
            'search': self.url_base + 'torrents.php?%s&searchstr=%s'
        }

        self.categories = {
            'Season': [10],
            'Episode': [10],
            'Cache': [10],
            'anime': [8]
        }

        self.url = self.urls['config_provider_home_uri']

        self.username, self.password, self.freeleech, self.minseed, self.minleech = 5 * [
            None
        ]
Beispiel #2
0
    def __init__(self):
        generic.TorrentProvider.__init__(self, 'TorrentDay')

        self.url_home = ['https://www.torrentday.com/'] + \
                        ['http://td.%s/' % b64decodestring(x) for x in [''.join(x) for x in [
                            [re.sub(r'(?i)[I\s1]+', '', x[::-1]) for x in [
                                'y92d', 'zl12a', 'y9mY', 'n5 Wa', 'vNmIL', '=i1=Qb']],
                            [re.sub(r'(?i)[T\sq]+', '', x[::-1]) for x in [
                                '15TWd', 'hV 3c', 'lBHb', 'vNncq', 'j5ib', '=qQ02b']],
                        ]]]

        self.url_vars = {'login': '******', 'search': 't?%s%s&qf=&p=%s&q=%s'}
        self.url_tmpl = {
            'config_provider_home_uri': '%(home)s',
            'login': '******',
            'search': '%(home)s%(vars)s'
        }

        self.categories = {
            'Season': [31, 33, 14],
            'Episode': [24, 32, 26, 7, 34, 2],
            'anime': [29]
        }
        self.categories[
            'Cache'] = self.categories['Season'] + self.categories['Episode']

        self.proper_search_terms = None

        self.digest, self.freeleech, self.minseed, self.minleech = 4 * [None]
Beispiel #3
0
    def __init__(self):

        generic.TorrentProvider.__init__(self, 'EZTV')

        self.url_home = ['https://eztv.ag/'] + \
                        ['https://%s/' % b64decodestring(x) for x in [''.join(x) for x in [
                            [re.sub(r'[v\sz]+', '', x[::-1]) for x in [
                                '0vp XZ', 'uvEj d', 'i5 Wzd', 'j9 vGb', 'kV2v a', '0zdvnL', '==vg Z']],
                            [re.sub(r'[f\sT]+', '', x[::-1]) for x in [
                                '0TpfXZ', 'ufTEjd', 'i5WTTd', 'j9f Gb', 'kV f2a', 'z1mTTL']],
                        ]]]
        self.url_vars = {'search': 'search/%s', 'browse': 'page_%s'}
        self.url_tmpl = {
            'config_provider_home_uri': '%(home)s',
            'search': '%(home)s%(vars)s',
            'browse': '%(home)s%(vars)s'
        }

        self.minseed = None
Beispiel #4
0
    def __init__(self):
        generic.TorrentProvider.__init__(self, 'IPTorrents')

        self.url_home = (['https://iptorrents.com/'] +
                         [b64decodestring(x) for x in [''.join(x) for x in [
                             [re.sub(r'(?i)[q\s1]+', '', x[::-1]) for x in [
                                 'c0RHa', 'vo1QD', 'hJ2L', 'GdhdXe', 'vdnLoN', 'J21cptmc', '5yZulmcv', '02bj', '=iq=']],
                             [re.sub(r'(?i)[q\seg]+', '', x[::-1]) for x in [
                                 'RqHEa', 'LvEoDc0', 'Zvex2', 'LuF2', 'NXdu Vn', 'XZwQxeWY1', 'Yu42bzJ', 'tgG92']],
                         ]]])

        self.url_vars = {'login': '******', 'search': 't?%s;q=%s;qf=ti%s%s;p=%s#torrents'}
        self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login': '******',
                         'search': '%(home)s%(vars)s'}

        self.categories = {'shows': [4, 5, 22, 23, 24, 25, 26, 55, 65, 66, 78, 79, 99], 'anime': [60]}

        self.proper_search_terms = None

        self.digest, self.freeleech, self.minseed, self.minleech = 4 * [None]
Beispiel #5
0
    def __init__(self):
        generic.TorrentProvider.__init__(self, 'The Pirate Bay')

        self.url_home = ['https://thepiratebay.se/'] + \
                        ['https://%s/' % b64decodestring(x) for x in [''.join(x) for x in [
                            [re.sub(r'[h\sI]+', '', x[::-1]) for x in [
                                'm IY', '5  F', 'HhIc', 'vI J', 'HIhe', 'uI k', '2  d', 'uh l']],
                            [re.sub(r'[N\sQ]+', '', x[::-1]) for x in [
                                'lN Gc', 'X  Yy', 'c lNR', 'vNJNH', 'kQNHe', 'GQdQu', 'wNN9']],
                        ]]]

        self.url_vars = {'search': 'search/%s/0/7/200', 'browse': 'tv/latest/',
                         'search2': 'search.php?q=%s&video=on&category=0&page=0&orderby=99', 'browse2': '?load=/recent'}
        self.url_tmpl = {'config_provider_home_uri': '%(home)s',
                         'search': '%(home)s%(vars)s', 'search2': '%(home)s%(vars)s',
                         'browse': '%(home)s%(vars)s', 'browse2': '%(home)s%(vars)s'}

        self.proper_search_terms = None

        self.minseed, self.minleech = 2 * [None]
        self.confirmed = False
Beispiel #6
0
    def __init__(self):
        generic.TorrentProvider.__init__(self, 'LimeTorrents')

        self.url_home = ['https://www.limetorrents.cc/'] + \
                        ['https://%s/' % b64decodestring(x) for x in [''.join(x) for x in [
                            [re.sub(r'[F\sp]+', '', x[::-1]) for x in [
                                'XZFtlpGb', 'lJn pcvR', 'nFLpzRnb', 'v xpmYuV', 'CZlt F2Y', '=F QXYs5']],
                            [re.sub(r'[K\sP]+', '', x[::-1]) for x in [
                                'XZKtPlGb', 'lJncPPvR', 'nKLzRnKb', 'vxm Y uV', 'CZlPt2PY', '==wYK2P5']],
                        ]]]

        self.url_vars = {
            'search': 'search/tv/%s/',
            'browse': 'browse-torrents/TV-shows/'
        }
        self.url_tmpl = {
            'config_provider_home_uri': '%(home)s',
            'search': '%(home)s%(vars)s',
            'browse': '%(home)s%(vars)s'
        }

        self.minseed, self.minleech = 2 * [None]
Beispiel #7
0
    def solve_cf_challenge(self, resp, **original_kwargs):
        body = resp.text
        parsed_url = urlparse(resp.url)
        domain = parsed_url.netloc

        if '/cdn-cgi/l/chk_captcha' in body or 'cf_chl_captcha' in body:
            raise CloudflareError(
                'Cloudflare captcha presented for %s, please notify SickGear for an update, ua: %s'
                % (domain, self.cf_ua),
                response=resp)

        try:
            action, method = re.findall(
                r'(?sim)<form.*?id="challenge.*?action="/?([^?"]+).*?method="([^"]+)',
                body)[0]
        except (Exception, BaseException):
            action, method = 'cdn-cgi/l/chk_jschl', resp.request.method
        submit_url = '%s://%s/%s' % (parsed_url.scheme, domain, action)

        cloudflare_kwargs = {
            k: v
            for k, v in original_kwargs.items() if k not in ['hooks']
        }
        params = cloudflare_kwargs.setdefault(
            ('data', 'params')['GET' == method.upper()], {})
        headers = cloudflare_kwargs.setdefault('headers', {})
        headers['Referer'] = resp.url
        try:
            token = re.findall(r'(?sim)__cf_chl_jschl_tk__=([^"]+)', body)[0]
            cloudflare_kwargs['params'] = dict(__cf_chl_jschl_tk__=token)
        except (Exception, BaseException):
            pass

        if self.delay == self.default_delay:
            try:
                # no instantiated delay, therefore check js for hard coded CF delay
                self.delay = float(
                    re.search(r'submit\(\);[^0-9]*?([0-9]+)',
                              body).group(1)) / float(1000)
            except (BaseException, Exception):
                pass

        for i in re.findall(r'(<input[^>]+?hidden[^>]+?>)',
                            re.sub(r'(?sim)<!--\s+<input.*?(?=<)', '', body)):
            value = re.findall(r'value="([^"\']+?)["\']', i)
            name = re.findall(r'name="([^"\']+?)["\']', i)
            if all([name, value]):
                params[name[0]] = value[0]

        js = self.extract_js(body, domain)
        atob = (lambda s: b64decodestring('%s' % s))
        try:
            # Eval the challenge algorithm
            params['jschl_answer'] = str(js2py.EvalJs({'atob': atob}).eval(js))
        except (BaseException, Exception):
            try:
                params['jschl_answer'] = str(
                    js2py.EvalJs({
                        'atob': atob
                    }).eval(js))
            except (BaseException, Exception) as e:
                # Something is wrong with the page. This may indicate Cloudflare has changed their anti-bot technique.
                raise ValueError(
                    'Unable to parse Cloudflare anti-bot IUAM page: %r' % e)

        # Requests transforms any request into a GET after a redirect,
        # so the redirect has to be handled manually here to allow for
        # performing other types of requests even as the first request.
        cloudflare_kwargs['allow_redirects'] = False

        self.wait()
        response = self.request(method, submit_url, **cloudflare_kwargs)
        if response:
            if 200 == getattr(response, 'status_code'):
                return response

            # legacy redirection handler (pre 2019.11.xx)
            location = response.headers.get('Location')
            try:
                r = urlparse(location)
            except (Exception, BaseException):
                # Something is wrong with the page, perhaps CF changed their anti-bot technique
                raise ValueError(
                    'Unable to find a new location from Cloudflare anti-bot IUAM page'
                )

            if not r.netloc or location.startswith('/'):
                location = urlunparse((parsed_url.scheme, domain, r.path,
                                       r.params, r.query, r.fragment))
            return self.request(resp.request.method, location,
                                **original_kwargs)