<commit_before>from providers.popularity.provider import PopularityProvider
from utils.torrent_util import torrent_to_movie, remove_bad_torrent_matches

IDENTIFIER = "kickasstorrents"

class Provider(PopularityProvider):
    PAGES_TO_FETCH = 1

    def get_popular(self):
        names = []
        for page in range(Provider.PAGES_TO_FETCH):
            url = "https://kat.cr/usearch/category%%3Ahighres-movies/%s/" % page
            names += self.parse_html(url, "#mainSearchTable .data .cellMainLink", cache=False)

        movies = [torrent_to_movie(name) for name in names]
        movies = remove_bad_torrent_matches(movies)
        return movies<commit_msg>Fix Kickasstorrents by using one of many mirrors.<commit_after>from providers.popularity.provider import PopularityProvider
from utils.torrent_util import torrent_to_movie, remove_bad_torrent_matches

IDENTIFIER = "kickasstorrents"

class Provider(PopularityProvider):
    PAGES_TO_FETCH = 3

    def get_popular(self):
        names = []
        base = "https://kickasstorrents.to/highres-movies/"
        # New mirrors can be found at https://thekickasstorrents.com/

        for page in range(Provider.PAGES_TO_FETCH):
            if page == 0:
                url = base
            else:
                url = base + "%s/" % (page + 1)

            names += self.parse_html(url, "#mainSearchTable .data .cellMainLink", cache=False)

        movies = [torrent_to_movie(name) for name in names]
        movies = remove_bad_torrent_matches(movies)
        return movies
{'fraction_non_alphanumeric': 0.08984375, 'fraction_numerical': 0.0032552083333333335, 'mean_word_length': 3.076923076923077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3733736', 'n_tokens_mistral': 502, 'n_tokens_neox': 468, 'n_words': 105}