diff options
| author | 2025-12-20 05:49:11 -0500 | |
|---|---|---|
| committer | 2025-12-20 05:49:11 -0500 | |
| commit | c586ea4b3c871f5696626f9820e8c88a4e78f4a6 (patch) | |
| tree | e6d7bae96282c3d147159f091d451e53bdaa2efe /gallery_dl/extractor/imagebam.py | |
| parent | 01a2bf622c31072d1322884584404b9bd59b28cc (diff) | |
| parent | a24ec1647aeac35a63b744ea856011ad6e06be3b (diff) | |
Update upstream source from tag 'upstream/1.31.1'
Update to upstream version '1.31.1'
with Debian dir b5d91c25143175f933b1c69c7e82249cd7e145ab
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 |
