1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

[ngomik] fix extraction

This commit is contained in:
Mike Fährmann 2019-02-10 14:19:08 +01:00
parent 02d733d219
commit 84ae72b8d8
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 10 additions and 16 deletions

View File

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

View File

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