From 43210391ea052e8c649781183f26ae0ec8cc28d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 3 Aug 2016 17:09:15 +0200 Subject: [PATCH] [imgyt] add extractor --- README.rst | 4 +-- gallery_dl/extractor/__init__.py | 1 + gallery_dl/extractor/imgyt.py | 43 ++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 gallery_dl/extractor/imgyt.py diff --git a/README.rst b/README.rst index 875e3072..c646b769 100644 --- a/README.rst +++ b/README.rst @@ -41,7 +41,7 @@ Supported Sites * Manga: bato.to, kissmanga.com, mangahere.co, mangamint.com, mangapanda.com, mangapark.me, mangareader.net, mangashare.com, mangastream.com, - powermanga.org, thespectrum.net + powermanga.org, raw.senmanga.com, thespectrum.net * Hentai: exhentai.org, hbrowse.com, hentai2read.com, hentai-foundry.com, hitomi.la, luscious.net, nhentai.net @@ -52,7 +52,7 @@ Supported Sites * Futaba Channel-like: 4chan.org, 8ch.net * Image Hosts: - chronos.to, imagebam.com, imagetwist.com, imgbox.com, imgchili.net, + chronos.to, imagebam.com, imagetwist.com, imgbox.com, imgchili.net, img.yt, turboimagehost.com diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py index 82768e88..bd830ab5 100644 --- a/gallery_dl/extractor/__init__.py +++ b/gallery_dl/extractor/__init__.py @@ -32,6 +32,7 @@ modules = [ "imgchili", "imgth", "imgur", + "imgyt", "khinsider", "kissmanga", "konachan", diff --git a/gallery_dl/extractor/imgyt.py b/gallery_dl/extractor/imgyt.py new file mode 100644 index 00000000..2bb314a4 --- /dev/null +++ b/gallery_dl/extractor/imgyt.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +# Copyright 2016 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 images from http://img.yt/""" + +from .common import Extractor, Message +from .. import text +from os.path import splitext + +class ImgytImageExtractor(Extractor): + + category = "imgyt" + directory_fmt = ["{category}"] + filename_fmt = "{filename}" + pattern = [r"(?:https?://)?(?:www\.)?img\.yt/img-([a-z0-9]+)\.html"] + test = [("http://img.yt/img-57a2050547b97.html", { + "url": "6801fac1ff8335bd27a1665ad27ad64cace2cd84", + "keyword": "a20aa2215a4a6d5f4605d6370a8d605b525fc4bc", + "content": "54592f2635674c25677c6872db3709d343cdf92f", + })] + + def __init__(self, match): + Extractor.__init__(self) + self.token = match.group(1) + + def items(self): + data = {"category": self.category, "token": self.token} + params = {"imgContinue": "Continue+to+image+...+"} + page = self.request("https://img.yt/img-" + self.token + ".html", + method="post", data=params).text + url , pos = text.extract(page, "