def get_img(self, type_id, part_id, ct=0): server = random.choice(self.pic_host_list) img = int(ct) + 1 url = '%s/Files/Images/%s/%s/imanhua_%03d.jpg' % (server, type_id, part_id, img) headers = { 'Referer' : 'http://www.imanhua.com/comic/%s/list_%s.html' % (type_id, part_id) } page = get_page(url, headers=headers) return page
def comic(self, type_id): if type_id not in self._cache: url = 'http://www.imanhua.com/comic/%s/' % type_id page = get_page(url) if page is None: return None res = list(self.parse_comic(type_id, page)) self._cache[type_id] = res return self._cache[type_id]
def get_img(self, type_id, part_id, ct=0): server = random.choice(self.pic_host_list) img = int(ct) + 1 url = '%s/Files/Images/%s/%s/imanhua_%03d.jpg' % (server, type_id, part_id, img) headers = { 'Referer': 'http://www.imanhua.com/comic/%s/list_%s.html' % (type_id, part_id) } page = get_page(url, headers=headers) return page