simplify code by using a MangaExtractor base class

This commit is contained in:
Mike Fährmann
2017-05-20 11:27:43 +02:00
parent 2974d782a3
commit f226417420
15 changed files with 134 additions and 216 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Mike Fährmann
# Copyright 2016-2017 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -13,19 +13,6 @@ from .. import text
import json
class HentaicdnMangaExtractor(Extractor):
"""Base class for extractors for mangas"""
subcategory = "manga"
def items(self):
yield Message.Version, 1
for chapter in reversed(list(self.get_chapters())):
yield Message.Queue, chapter
def get_chapters(self):
"""Return a list of all chapter urls"""
class HentaicdnChapterExtractor(Extractor):
"""Base class for extractors for a single manga chapter"""
subcategory = "chapter"