def getChannel(self, channel, page=1): channel = channel.replace(self.domain, "") if page > 1: url = '%s%s/page/%d' % (self.domain, channel, page) else: url = '%s%s' % (self.domain, channel) response = Request().get(url) return Channel().get(response, page, self.domain)
def search(self, text): url = "%s/film/search?keyword=%s" % (self.domain, urllib.quote_plus(text)) response = Request().get(url) return Channel().get(response, 1, self.domain)