Exemplo n.º 1
0
    def browse(self, category, page=1):
        category = category.upper() if category.lower() in [
            'xxx', 'tv'
        ] else category.capitalize()
        url = f'{self.baseUrl}/cat/{category}/{page}/'

        response = self.requests.get(url, headers=self.headers)
        return parser.torrentParser(response, baseUrl=self.baseUrl, page=page)
Exemplo n.º 2
0
    def top(self, category=None):
        category = 'applications' if category and category.lower(
        ) == 'apps' else 'television' if category and category.lower(
        ) == 'tv' else category.lower() if category else None
        url = f"{self.baseUrl}/top-100{'-'+category if category else ''}"

        response = self.requests.get(url, headers=self.headers)
        return parser.torrentParser(response, baseUrl=self.baseUrl)
Exemplo n.º 3
0
    def search(self, query, page=1, category=None, sortBy=None, order='desc'):
        query = '+'.join(query.split())
        category = category.upper() if category and category.lower() in [
            'xxx', 'tv'
        ] else category.capitalize() if category else None
        url = f"{self.baseUrl}/{'sort-' if sortBy else ''}{'category-' if category else ''}search/{query}/{category+'/' if category else ''}{sortBy.lower()+'/' if sortBy else ''}{order.lower()+'/' if sortBy else ''}{page}/"

        response = self.requests.get(url, headers=self.headers)
        return parser.torrentParser(response, baseUrl=self.baseUrl, page=page)
Exemplo n.º 4
0
    def popular(self, category, week=False):
        url = f"{self.baseUrl}/popular-{category.lower()}{'-week' if week else ''}"

        response = self.requests.get(url, headers=self.headers)
        return parser.torrentParser(response, baseUrl=self.baseUrl)
Exemplo n.º 5
0
    def trending(self, category=None, week=False):
        url = f"{self.baseUrl}/trending{'-week' if week and not category else ''}{'/w/'+category.lower()+'/' if week and category else '/d/'+category.lower()+'/' if not week and category else ''}"

        response = self.requests.get(url, headers=self.headers)
        return parser.torrentParser(response, baseUrl=self.baseUrl)