From 2afa65cfc75bd5ae8c74e696ed6c84512da19ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 2 Sep 2016 08:25:29 +0200 Subject: [PATCH] [imagebam] add single-image extractor --- gallery_dl/extractor/imagebam.py | 42 +++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/imagebam.py b/gallery_dl/extractor/imagebam.py index c0df1ae4..e2d05bb3 100644 --- a/gallery_dl/extractor/imagebam.py +++ b/gallery_dl/extractor/imagebam.py @@ -1,22 +1,28 @@ # -*- coding: utf-8 -*- -# Copyright 2014, 2015 Mike Fährmann +# Copyright 2014-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 galleries at http://www.imagebam.com/""" +"""Extract images from http://www.imagebam.com/""" -from .common import AsynchronousExtractor, Message +from .common import Extractor, AsynchronousExtractor, Message from .. import text -class ImagebamExtractor(AsynchronousExtractor): +class ImagebamGalleryExtractor(AsynchronousExtractor): category = "imagebam" + subcategory = "gallery" directory_fmt = ["{category}", "{title} - {gallery-key}"] filename_fmt = "{num:>03}-{filename}" pattern = [r"(?:https?://)?(?:www\.)?imagebam\.com/gallery/([^/]+).*"] + test = [("http://www.imagebam.com/gallery/adz2y0f9574bjpmonaismyrhtjgvey4o", { + "url": "d7a4483b6d5ebba81950a349aad58ae034c60eda", + "keyword": "9f54ab808d77f2517444411dfbf8686189c20b43", + "content": "596e6bfa157f2c7169805d50075c2986549973a8", + })] url_base = "http://www.imagebam.com" def __init__(self, match): @@ -62,3 +68,31 @@ class ImagebamExtractor(AsynchronousExtractor): image_id , pos = text.extract(page, '