diff --git a/README.rst b/README.rst index 076e3a8d..208c4c16 100644 --- a/README.rst +++ b/README.rst @@ -54,8 +54,8 @@ Supported Sites * Futaba Channel-like: 4chan.org, 8ch.net * Image Hosts: - chronos.to, imagebam.com, imagetwist.com, img.yt, imgbox.com, imgchili.net, - turboimagehost.com + chronos.to, coreimg.net, imagebam.com, imagetwist.com, img.yt, imgbox.com, + imgcandy.net, imgchili.net, imgtrex.com. turboimagehost.com Configuration diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py index 5d026035..2ba67bc8 100644 --- a/gallery_dl/extractor/__init__.py +++ b/gallery_dl/extractor/__init__.py @@ -36,6 +36,7 @@ modules = [ "imgcandy", "imgchili", "imgth", + "imgtrex", "imgur", "imgyt", "khinsider", diff --git a/gallery_dl/extractor/imgtrex.py b/gallery_dl/extractor/imgtrex.py new file mode 100644 index 00000000..eb43154a --- /dev/null +++ b/gallery_dl/extractor/imgtrex.py @@ -0,0 +1,38 @@ +# -*- 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://imgtrex.com/""" + +from .common import Extractor, Message +from .. import text + +class ImgtrexImageExtractor(Extractor): + """Extractor for single images from imgtrex.com""" + category = "imgtrex" + directory_fmt = ["{category}"] + filename_fmt = "{filename}" + pattern = [r"(?:https?://)?(?:www\.)?imgtrex\.com/([^/]+)"] + test = [("http://imgtrex.com/im0ypxq0rke4/test-テスト-&.png", { + "url": "c000618bddda42bd599a590b7972c7396d19d8fe", + "keyword": "4d766eae04aa5457bca4992290aa28b76239d287", + "content": "0c8768055e4e20e7c7259608b67799171b691140", + })] + + def __init__(self, match): + Extractor.__init__(self) + self.token = match.group(1) + + def items(self): + data = {"category": self.category, "token": self.token} + page = self.request("http://imgtrex.com/" + self.token).text + filename, pos = text.extract(page, 'ImgTrex: ', '') + url , pos = text.extract(page, '
\n