1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[fallenangels] add manga extractor

This commit is contained in:
Mike Fährmann 2017-05-21 10:36:29 +02:00
parent f226417420
commit 832a4a8ee9
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 23 additions and 3 deletions

View File

@ -23,7 +23,7 @@ Supported Sites
+-------------------+---------------------------------------+----------------------------------------------------------+
|ExHentai |https://exhentai.org/ |Galleries |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Fallen Angels Scans|https://fascans.com/ |Chapters |
|Fallen Angels Scans|https://www.fascans.com/ |Chapters, Manga |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Gelbooru |https://gelbooru.com/ |Posts, Tag-Searches |
+-------------------+---------------------------------------+----------------------------------------------------------+

View File

@ -6,10 +6,11 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Extract manga-chapters from https://fascans.com/"""
"""Extract manga-chapters from https://www.fascans.com/"""
from .common import Extractor, Message
from .common import Extractor, MangaExtractor, Message
from .. import text, util
import re
import json
@ -66,3 +67,22 @@ class FallenangelsChapterExtractor(Extractor):
def get_images(page):
"""Return a list of all images in this chapter"""
return json.loads(text.extract(page, "var pages = ", ";")[0])
class FallenangelsMangaExtractor(MangaExtractor):
"""Extractor for manga from fascans.com"""
category = "fallenangels"
pattern = [r"(?:https?://)?((manga|truyen)\.fascans\.com/manga/[^/]+)/?$"]
scheme = "https"
test = [
("http://manga.fascans.com/manga/trinity-seven", {
"url": "8da3d4bcbadc173e5b23c141a0e646b35f41b9b0",
}),
("https://truyen.fascans.com/manga/rakudai-kishi-no-eiyuutan", {
"url": "d332d08ce522c7943cd80d3fd361391190444a26",
}),
]
def chapters(self, page):
pattern = r'<h3 class="chapter-title-rtl">\s+<a href="([^"]+)"'
return re.findall(pattern, page)