# -*- coding: utf-8 -*- # Copyright 2016-2017 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 hentai-manga from https://hentai2read.com/""" from .common import MangaExtractor from .. import text, util from . import hentaicdn import re import json class Hentai2readMangaExtractor(MangaExtractor): """Extractor for hmanga from hentai2read.com""" category = "hentai2read" scheme = "https" pattern = [r"(?:https?://)?(?:www\.)?(hentai2read\.com/[^/]+/?)$"] test = [ ("http://hentai2read.com/amazon_elixir/", { "url": "273073752d418ec887d7f7211e42b832e8c403ba", "keyword": "13c1ce7e15cbb941f01c843b0e89adc993d939ac", }), ("http://hentai2read.com/oshikage_riot/", { "url": "6595f920a3088a15c2819c502862d45f8eb6bea6", "keyword": "675c7b7a4fa52cf569c283553bd16b4200a5cd36", }), ] def chapters(self, page): results = [] manga, pos = text.extract( page, '', '') mtype, pos = text.extract( page, '[', ']', pos) manga_id = util.safe_int(text.extract(page, 'data-mid="', '"', pos)[0]) page, pos = text.extract( page, '
\n') pos = 0 while True: url, pos = text.extract(page, '