def chapters(self): ret = [self.site.Chapter(self, Util.unescape(match.group('title') or ''), match.group('url')) for match in self.CHAPTER_FROM_SOURCE_REGEX.finditer(self.source)] ret.reverse() return ret
def chapter(self): """ :rtype: str or None """ match = self.VOLUME_AND_CHAPTER_FROM_URL_REGEX.match(self.url) if match is not None and match.group('chapter') is not None: return Util.normalize_value(match.group('chapter')) else: return None
def chapters(self): """ :rtype: OrderedDict of (str, MetaChapter) """ all_chapters = _.flatten([ site.series(self.name).chapters for site in self.site.modules ]) chapter_map = OrderedDict( Util.natural_sort( _.groupBy(all_chapters, lambda chapter, index: chapter.chapter).items(), key=lambda t: t[0] ) ) return OrderedDict( (chapter, MetaSite.MetaChapter(self, chapter, choices)) for chapter, choices in chapter_map.items())
def source(self): return Util.getSourceCode(self.url)
def chapters(self): ret = [self.site.Chapter(self, Util.unescape(match.group('title') or ''), self.TEMPLATE_URL.format(path=match.group('path'))) for match in self.CHAPTER_FROM_SOURCE_REGEX.finditer(self.source)] return ret