diff options
Diffstat (limited to 'gallery_dl/extractor/imagebam.py')
| -rw-r--r-- | gallery_dl/extractor/imagebam.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gallery_dl/extractor/imagebam.py b/gallery_dl/extractor/imagebam.py index abba9df..66fbdd6 100644 --- a/gallery_dl/extractor/imagebam.py +++ b/gallery_dl/extractor/imagebam.py @@ -9,7 +9,7 @@ """Extractors for https://www.imagebam.com/""" from .common import Extractor, Message -from .. import text, util +from .. import text class ImagebamExtractor(Extractor): @@ -30,12 +30,10 @@ class ImagebamExtractor(Extractor): url, pos = text.extract(page, '<img src="https://images', '"') filename = text.unescape(text.extract(page, 'alt="', '"', pos)[0]) - data = { + return text.nameext_from_name(filename, { "url" : "https://images" + url, "image_key": path.rpartition("/")[2], - } - data["filename"], _, data["extension"] = filename.rpartition(".") - return data + }) class ImagebamGalleryExtractor(ImagebamExtractor): @@ -58,7 +56,7 @@ class ImagebamGalleryExtractor(ImagebamExtractor): data["count"] = len(images) data["gallery_key"] = self.path.rpartition("/")[2] - yield Message.Directory, data + yield Message.Directory, "", data for data["num"], path in enumerate(images, 1): image = self._parse_image_page(path) image.update(data) @@ -69,7 +67,7 @@ class ImagebamGalleryExtractor(ImagebamExtractor): page, 'id="gallery-name">', '<').strip())} def images(self, page): - findall = util.re(r'<a href="https://www\.imagebam\.com' + findall = text.re(r'<a href="https://www\.imagebam\.com' r'(/(?:image/|view/M)[a-zA-Z0-9]+)').findall paths = [] while True: @@ -96,5 +94,5 @@ class ImagebamImageExtractor(ImagebamExtractor): path = ("/view/" if path[10] == "M" else "/image/") + path[10:] image = self._parse_image_page(path) - yield Message.Directory, image + yield Message.Directory, "", image yield Message.Url, image["url"], image |
