# VERSION: 1.6 # AUTHORS: LightDestory (https://github.com/LightDestory), BurningMop (https://github.com/BurningMop) import re from time import sleep from helpers import retrieve_url from novaprinter import prettyPrinter class glotorrents(object): url = 'https://glodls.to/' name = 'GloTorrents' supported_categories = {'all': '0', 'movies': '1', 'tv': '41', 'music': '22', 'games': '10', 'anime': '28', 'software': '18'} class HTMLParser: def __init__(self, url): self.url = url self.noTorrents = False def feed(self, html): self.noTorrents = False torrents = self.__findTorrents(html) if len(torrents) == 0: self.noTorrents = True return for torrent in range(len(torrents)): data = { 'link': torrents[torrent][0], 'name': torrents[torrent][1], 'size': torrents[torrent][2], 'seeds': torrents[torrent][3], 'leech': torrents[torrent][4], 'engine_url': self.url, 'desc_link': torrents[torrent][5] } prettyPrinter(data) def __findTorrents(self, html): torrents = [] trs = re.findall( r'