diff --git a/gallery_dl/extractor/mangapark.py b/gallery_dl/extractor/mangapark.py index 3df3389b..f1bbdbfb 100644 --- a/gallery_dl/extractor/mangapark.py +++ b/gallery_dl/extractor/mangapark.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2015-2018 Mike Fährmann +# Copyright 2015-2019 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 @@ -10,6 +10,7 @@ from .common import ChapterExtractor, MangaExtractor from .. import text, exception +import json class MangaparkExtractor(): @@ -112,7 +113,6 @@ class MangaparkChapterExtractor(MangaparkExtractor, ChapterExtractor): ("path" , "var _book_link = '", "'"), ("manga" , "

", "

"), ("title" , "", "<"), - ("count" , 'page 1">1 / ', '<'), ), values={"lang": "en", "language": "English"})[0] if not data["path"]: @@ -122,20 +122,18 @@ class MangaparkChapterExtractor(MangaparkExtractor, ChapterExtractor): data["manga"], _, data["type"] = data["manga"].rpartition(" ") data["manga"] = text.unescape(data["manga"]) data["title"] = data["title"].partition(": ")[2] - for key in ("manga_id", "chapter_id", "stream", "count"): + for key in ("manga_id", "chapter_id", "stream"): data[key] = text.parse_int(data[key]) return data def get_images(self, page): - pos = 0 - while True: - url, pos = text.extract(page, ' target="_blank" href="', '"', pos) - if not url: - return - width , pos = text.extract(page, ' width="', '"', pos) - height, pos = text.extract(page, ' _heighth="', '"', pos) - yield text.urljoin(self.root, url), { - "width": text.parse_int(width), - "height": text.parse_int(height), - } + data = json.loads(text.extract( + page, "var _load_pages =", ";")[0] or "[]") + return [ + (text.urljoin(self.root, item["u"]), { + "width": text.parse_int(item["w"]), + "height": text.parse_int(item["h"]), + }) + for item in data + ] diff --git a/gallery_dl/extractor/newgrounds.py b/gallery_dl/extractor/newgrounds.py index bee2eb7a..e3f02b7a 100644 --- a/gallery_dl/extractor/newgrounds.py +++ b/gallery_dl/extractor/newgrounds.py @@ -131,7 +131,8 @@ class NewgroundsVideoExtractor(NewgroundsExtractor): filename_fmt = "{category}_{index}.{extension}" pattern = [r"(?:https?://)?([^.]+)\.newgrounds\.com/movies/?$"] test = [("https://twistedgrim.newgrounds.com/movies", { - "url": "618a8f01f35dae140bd0a7fe071f437497555c8f", + "pattern": r"ytdl:https?://www\.newgrounds\.com/portal/view/\d+", + "count": ">= 29", })] def get_page_urls(self): diff --git a/test/test_results.py b/test/test_results.py index 48503add..d3331f35 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -24,8 +24,8 @@ TRAVIS_SKIP = { # temporary issues, etc. BROKEN = { "desuarchive", + "mangahere", "rbt", - "simplyhentai", }