[ngomik] add replacement for 'subapics'

http://subapics.com/ got discontinued and replaced by http://ngomik.in/.

ngomik.in is still displaying a link to the "old site" showing a big
"Account Suspended" sign.
This commit is contained in:
Mike Fährmann
2018-08-23 15:29:53 +02:00
parent a2eeef1f5e
commit ab2bfaeb46
4 changed files with 55 additions and 65 deletions

View File

@@ -51,6 +51,7 @@ MangaDex https://mangadex.org/ Chapters, Manga
Mangapanda https://www.mangapanda.com/ Chapters, Manga
MangaPark https://mangapark.me/ Chapters, Manga
Mangareader https://www.mangareader.net/ Chapters, Manga
Ngomik http://ngomik.in/ Chapters
nhentai https://nhentai.net/ Galleries, Search Results
Niconico Seiga http://seiga.nicovideo.jp Images from Users, individual Images Required
nijie https://nijie.info/ |Images from Use-3| Required
@@ -73,7 +74,6 @@ Sense-Scans http://sensescans.com/ Chapters, Manga
Simply Hentai https://www.simply-hentai.com/ Galleries, individual Images, Videos
SlideShare https://www.slideshare.net/ Presentations
SmugMug https://www.smugmug.com/ |Albums, individ-5| Optional (OAuth)
Subapics https://subapics.com/ Chapters, Manga
The /b/ Archive https://thebarchive.com/ Threads
Tumblr https://www.tumblr.com/ Images from Users, Likes, Posts, Tag-Searches Optional (OAuth)
Twitter https://twitter.com/ Timelines, Tweets, Media Tweets

View File

@@ -58,6 +58,7 @@ modules = [
"mangareader",
"mangastream",
"myportfolio",
"ngomik",
"nhentai",
"nijie",
"nyafuu",
@@ -80,7 +81,6 @@ modules = [
"simplyhentai",
"slideshare",
"smugmug",
"subapics",
"thebarchive",
"tumblr",
"twitter",

View File

@@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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
# published by the Free Software Foundation.
"""Extract manga-chapters and entire manga from http://ngomik.in/"""
from .common import ChapterExtractor
from .. import text
class NgomikChapterExtractor(ChapterExtractor):
"""Extractor for manga-chapters from ngomik.in"""
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",
})]
def __init__(self, match):
url = "{}/manga/{}?style=list".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(".")
return {
"manga": text.unescape(manga),
"chapter": text.parse_int(chapter),
"chapter_minor": sep + minor,
"lang": "id",
"language": "Indonesian",
}
@staticmethod
def get_images(page):
readerarea = text.extract(
page, '<div class="page-break">', '<div class="select-view">')[0]
return [
(url, None)
for url in text.extract_iter(
readerarea, ' src="', '"'
)
]

View File

@@ -1,63 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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
# published by the Free Software Foundation.
"""Extract manga-chapters and entire manga from https://subapics.com/"""
from . import komikcast
from .. import text
class SubapicsBase(komikcast.KomikcastBase):
"""Base class for subapics extractors"""
category = "subapics"
root = "https://subapics.com"
class SubapicsChapterExtractor(SubapicsBase,
komikcast.KomikcastChapterExtractor):
"""Extractor for manga-chapters from subapics.com"""
pattern = [r"(?:https?://)?(?:www\.)?subapics\.com"
r"(/[^/?&#]+-chapter-[^/?&#]+/?)$"]
test = [("http://subapics.com/apotheosis-chapter-02-2/", {
"url": "978d3c053d34a77f6ea6e60cbba3deda1e369be8",
"keyword": "ed64479aef5a68aafa39334515f34a4595858c3c",
})]
@staticmethod
def get_images(page):
readerarea = text.extract(
page, '<div id="readerarea">', '<meta/>')[0]
return [
(url, None)
for url in text.extract_iter(
readerarea, ' src="', '"'
)
]
class SubapicsMangaExtractor(SubapicsBase,
komikcast.KomikcastMangaExtractor):
"""Extractor for manga from subapics.com"""
pattern = [r"(?:https?://)?(?:www\.)?(subapics\.com/manga/[^/?&#]+/?)$"]
test = [(("https://subapics.com/manga/"
"rune-factory-4-koushiki-comic-visual-book/"), {
"url": "6b18ba9513a6c92a23df1b78b11a1ad0013c6e5e",
"keyword": "2fffe06b93b7ac8c4bb61f44398326deaf59fcf9",
})]
@staticmethod
def get_metadata(page):
manga , pos = text.extract(page, "<title>", "</title>")
author, pos = text.extract(page, "<b>Author</b>: ", "</li>", pos)
genres, pos = text.extract(page, "<b>Genres</b>: ", "</li>", pos)
return {
"manga": text.unescape(manga.rpartition(" ")[0]),
"author": text.unescape(author),
"genres": text.remove_html(genres).replace(" , ", ", "),
}