From 12c99293b6b106e357cc635d8cb289b75c326f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 30 Sep 2016 16:43:43 +0200 Subject: [PATCH] allow extension by Content-Type for exhentai, seiga, senmanga --- gallery_dl/extractor/exhentai.py | 1 + gallery_dl/extractor/seiga.py | 2 +- gallery_dl/extractor/senmanga.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index 59e9b3b2..44d6b033 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -53,6 +53,7 @@ class ExhentaiGalleryExtractor(Extractor): for url, image in self.get_images(page): data.update(image) if "/fullimg.php" in url: + data["extension"] = "" self.wait((1, 2)) yield Message.Url, url, data diff --git a/gallery_dl/extractor/seiga.py b/gallery_dl/extractor/seiga.py index 96f3d4a4..72d25bb3 100644 --- a/gallery_dl/extractor/seiga.py +++ b/gallery_dl/extractor/seiga.py @@ -17,7 +17,7 @@ class SeigaImageExtractor(Extractor): category = "seiga" subcategory = "image" directory_fmt = ["{category}"] - filename_fmt = "{category}_{image-id}.jpg" + filename_fmt = "{category}_{image-id}.{extension}" pattern = [(r"(?:https?://)?(?:www\.|seiga\.)?nicovideo\.jp/" r"(?:seiga/im|image/source/)(\d+)"), (r"(?:https?://)?lohas\.nicoseiga\.jp/" diff --git a/gallery_dl/extractor/senmanga.py b/gallery_dl/extractor/senmanga.py index 6db581ee..4f35165e 100644 --- a/gallery_dl/extractor/senmanga.py +++ b/gallery_dl/extractor/senmanga.py @@ -20,7 +20,7 @@ class SenmangaChapterExtractor(Extractor): pattern = [r"(?:https?://)?raw\.senmanga\.com/([^/]+/[^/]+)"] test = [("http://raw.senmanga.com/Bokura-wa-Minna-Kawaisou/37A/1", { "url": "32d88382fcad66859d089cd9a61249f375492ec5", - "keyword": "465905e0b69998656f9d59462a9560319941c58d", + "keyword": "bd25a8d00c8507faa5cdd6146a872797486fbf93", "content": "a791dda85ac0d37e3b36d754560cbb65b8dab5b9", })] url_base = "http://raw.senmanga.com" @@ -38,10 +38,10 @@ class SenmangaChapterExtractor(Extractor): yield Message.Version, 1 yield Message.Directory, data yield Message.Headers, self.session.headers - data["extension"] = "jpg" #TODO for i in range(int(data["count"])): page = str(i+1) data["page"] = page + data["extension"] = "" yield Message.Url, self.img_url + page, data def get_job_metadata(self):