From 81b35ed3cbc1580cb7608cfd18ef5262507134b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 29 Jul 2019 16:54:31 +0200 Subject: [PATCH] [exhentai] catch more error states (#356, #360) - warn on MPV-enabled galleries - catch parsing errors for gallery pages and image info - write page content to debug output --- gallery_dl/extractor/exhentai.py | 42 ++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index e4d4cd96e9..8b2bd94a38 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -136,6 +136,14 @@ def items(self): if self.gallery_token: gpage = self._gallery_page() self.image_token = text.extract(gpage, 'hentai.org/s/', '"')[0] + if "hentai.org/mpv/" in gpage: + self.log.warning("Extraction with Multi-Page Viewer " + "enabled is not supported") + if not self.image_token: + self.log.error("Failed to extract image token " + "from gallery page") + self.log.debug("Page content:\n%s", gpage) + return self.wait() ipage = self._image_page() else: @@ -201,12 +209,16 @@ def image_from_page(self, page): iurl = extr('