<commit_before># VERSION: 1.02
# AUTHORS: MrNeon

from novaprinter import prettyPrinter
from helpers import retrieve_url, download_file
import json

class strikesearch(object):
    url = 'https://getstrike.net/'
    name = 'Strike Search'
    supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'anime': 'Anime', 'books': 'Books',
                            'music': 'Music', 'games': 'Games', 'software': 'Applications'}

    def __init__(self):
        pass

    def download_torrent(self, info):
        print(download_file(info))

    def search(self, what, cat='all'):
        json_data = retrieve_url("".join((self.url, 'api/v2/torrents/search/?phrase=', what,
                                          '&category=', self.supported_categories.get(cat, ''))))
        json_dict = json.loads(json_data)

        if json_dict['results'] < 1:
            return

        for r in json_dict['torrents']:
            r_dict = {'link'        : r['magnet_uri'],
                      'name'        : r['torrent_title'],
                      'size'        : str(r['size']) + 'B',
                      'seeds'       : r['seeds'],
                      'leech'       : r['leeches'],
                      'desc_link'   : r['page'],
                      'engine_url'  : self.url}
            prettyPrinter(r_dict)<commit_msg>Tidy up. Version bump.<commit_after>#VERSION: 1.03
#AUTHORS: MrNeon

from novaprinter import prettyPrinter
from helpers import retrieve_url, download_file
import json


class strikesearch(object):
    url = 'https://getstrike.net/'
    name = 'Strike Search'
    supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'anime': 'Anime', 'books': 'Books',
                            'music': 'Music', 'games': 'Games', 'software': 'Applications'}

    def __init__(self):
        pass

    def download_torrent(self, info):
        print(download_file(info))

    def search(self, what, cat='all'):
        json_data = retrieve_url("".join((self.url, 'api/v2/torrents/search/?phrase=', what,
                                          '&category=', self.supported_categories.get(cat, ''))))
        json_dict = json.loads(json_data)

        if json_dict['results'] < 1:
            return

        for r in json_dict['torrents']:
            r_dict = {'link': r['magnet_uri'],
                      'name': r['torrent_title'],
                      'size': str(r['size']) + 'B',
                      'seeds': r['seeds'],
                      'leech': r['leeches'],
                      'desc_link': r['page'],
                      'engine_url': self.url}
            prettyPrinter(r_dict)
{'fraction_non_alphanumeric': 0.15448693676637637, 'fraction_numerical': 0.003786444528587656, 'mean_word_length': 1.9420935412026725, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7171930', 'n_tokens_mistral': 818, 'n_tokens_neox': 776, 'n_words': 167}