def search(self, what, cat="all"): """ Performs search """ connection = http("extratorrent.cc") query = "".join(("/advanced_search/?with=", what, "&s_cat=", self.supported_categories[cat])) connection.request("GET", query) response = connection.getresponse() if response.status != 200: return list_searches = [] parser = self.MyHtmlParseWithBlackJack(list_searches, self.url) parser.feed(response.read().decode('utf-8')) parser.close() for search_query in list_searches: connection.request("GET", search_query) response = connection.getresponse() parser.feed(response.read().decode('utf-8')) parser.close() connection.close() return
def search(self, what, cat="all"): """ Performs search """ list_searches = [] parser = self.MyHtmlParseWithBlackJack(list_searches, self.url) headers = { "Content-type": "application/x-www-form-urlencoded", "X-Requested-With": "XMLHttpRequest" } connection = http("linuxtracker.org") i = 1 while i < 15: query = "cat=%s&page=%d&srcrel=%s" % ( self.supported_categories[cat], i, what) connection.request("POST", "/index.php?page=torrents", query, headers) response = connection.getresponse() if response.status != 200: return html = response.read().decode('utf-8') parser.feed(html) if len(list_searches) < 1: break del list_searches[:] i += 1 connection.close() parser.close()
def search(self, what, cat="all"): """ Performs search """ connection = http("www.mininova.org") query = "/".join(("/search", what, self.supported_categories[cat], "seeds")) connection.request("GET", query) response = connection.getresponse() if response.status != 200: return list_searches = [] parser = self.MyHtmlParseWithBlackJack(list_searches, self.url) parser.feed(response.read().decode('utf-8')) parser.close() parser.next_queries = False for search_query in list_searches: connection.request("GET", search_query) response = connection.getresponse() parser.feed(response.read().decode('utf-8')) parser.close() connection.close() return
def search(self, what, cat="all"): """ Performs search """ connection = http("www.mininova.org") query = "/".join( ("/search", what, self.supported_categories[cat], "seeds")) connection.request("GET", query) response = connection.getresponse() if response.status != 200: return list_searches = [] parser = self.MyHtmlParseWithBlackJack(list_searches, self.url) parser.feed(response.read().decode('utf-8')) parser.close() parser.next_queries = False for search_query in list_searches: connection.request("GET", search_query) response = connection.getresponse() parser.feed(response.read().decode('utf-8')) parser.close() connection.close() return
def search(self, what, cat="all"): """ Performs search """ list_searches = [] parser = self.MyHtmlParseWithBlackJack(list_searches, self.url) headers = {"Content-type": "application/x-www-form-urlencoded", "X-Requested-With": "XMLHttpRequest"} connection = http("www.tntvillage.scambioetico.org") i = 1 while i < 15: query = "cat=%s&page=%d&srcrel=%s" % (self.supported_categories[cat], i, what) connection.request("POST", "/src/releaselist.php", query, headers) response = connection.getresponse() if response.status != 200: return html = response.read().decode('utf-8') parser.feed(html) if len(list_searches) < 1: break del list_searches[:] i += 1 connection.close() parser.close()