[ngomik] fix extraction

pull/170/head
Mike Fährmann 6 years ago
parent 02d733d219
commit 84ae72b8d8
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -17,21 +17,20 @@ class NgomikChapterExtractor(ChapterExtractor):
category = "ngomik" category = "ngomik"
root = "http://ngomik.in" root = "http://ngomik.in"
pattern = (r"(?:https?://)?(?:www\.)?ngomik\.in" pattern = (r"(?:https?://)?(?:www\.)?ngomik\.in"
r"/manga/([^/?&#]+/chapter-[^/?&#]+)") r"/([^/?&#]+-chapter-[^/?&#]+)")
test = (("http://ngomik.in/manga/chuuko-demo-koi-ga-shitai" test = ("https://www.ngomik.in/14-sai-no-koi-chapter-1-6/", {
"/chapter-21-5?style=list"), { "url": "8e67fdf751bbc79bc6f4dead7675008ddb8e32a4",
"url": "e87ed713f31d576013f179b50b4e10d7c678e53a", "keyword": "7cc913ed2b9018afbd3336755d28b8252d83044c",
"keyword": "a774caea148fc18a7d889f453dadbe3def9e0c2c",
}) })
def __init__(self, match): def __init__(self, match):
url = "{}/manga/{}?style=list".format(self.root, match.group(1)) url = "{}/{}".format(self.root, match.group(1))
ChapterExtractor.__init__(self, url) ChapterExtractor.__init__(self, url)
def get_metadata(self, page): def get_metadata(self, page):
info = text.extract(page, '<title>', "</title>")[0] info = text.extract(page, '<title>', "</title>")[0]
manga, chapter, _ = info.split(" - ") manga, _, chapter = info.partition(" Chapter ")
chapter, sep, minor = chapter.rpartition(" ")[2].partition(".") chapter, sep, minor = chapter.partition(" ")[0].partition(".")
return { return {
"manga": text.unescape(manga), "manga": text.unescape(manga),
@ -43,11 +42,8 @@ class NgomikChapterExtractor(ChapterExtractor):
@staticmethod @staticmethod
def get_images(page): def get_images(page):
readerarea = text.extract( readerarea = text.extract(page, 'id="readerarea"', 'class="chnav"')[0]
page, '<div class="page-break', '<div class="select-view')[0]
return [ return [
(url, None) (text.unescape(url), None)
for url in text.extract_iter( for url in text.extract_iter(readerarea, ' src="', '"')
readerarea, ' src="', '"'
)
] ]

@ -24,8 +24,6 @@ TRAVIS_SKIP = {
# temporary issues, etc. # temporary issues, etc.
BROKEN = { BROKEN = {
"mangahere", "mangahere",
"ngomik",
"simplyhentai",
} }

Loading…
Cancel
Save