Skip to content

Commit

Permalink
[fallenangels] add manga extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed May 21, 2017
1 parent f226417 commit 832a4a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/supportedsites.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
+-------------------+---------------------------------------+----------------------------------------------------------+
Expand Down
24 changes: 22 additions & 2 deletions gallery_dl/extractor/fallenangels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -66,3 +67,22 @@ def get_metadata(self, page):
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)

0 comments on commit 832a4a8

Please sign in to comment.