def novel_node_integrate(self, novel_node): """ 单本小说信息的整合处理 """ clean = NovelCleanModule() clean.novel_chapter_clean(novel_node) if novel_node.site_status == 0: novel_node.site_status = 1 if novel_node.site_status == 2: novel_node.site_status = 0 return True
def check_chapter_title_clean(gid): """ 检查一本书的标题过滤 和 虚拟目录效果 """ cluster_edge = ClusterEdgeModule() cluster_similarity = NovelSimilarityModule() novel_clean = NovelCleanModule() cluster_node = cluster_edge.cluster_node_collection(gid) if cluster_node is False: return False print('book_name: {0}, pen_name: {1}'.format(cluster_node.book_name, cluster_node.pen_name)) for novel_node in cluster_node.novel_node_list: for chapter in novel_node.chapter_list: chapter.chapter_title = chapter.raw_chapter_title novel_clean.novel_chapter_clean(novel_node) print(novel_node.dir_url) print(', '.join('%s' % chapter.chapter_title.encode('GBK', 'ignore') for chapter in novel_node.chapter_list)) print(', '.join('%s' % chapter.raw_chapter_title.encode('GBK', 'ignore') for chapter in novel_node.chapter_list))