summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/imgbox.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-12-20 05:49:04 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2025-12-20 05:49:04 -0500
commita24ec1647aeac35a63b744ea856011ad6e06be3b (patch)
treeae94416de786aeddd05d99559098f7f16bb103a6 /gallery_dl/extractor/imgbox.py
parent33f8a8a37a9cba738ef25fb99955f0730da9eb48 (diff)
New upstream version 1.31.1.upstream/1.31.1
Diffstat (limited to 'gallery_dl/extractor/imgbox.py')
-rw-r--r--gallery_dl/extractor/imgbox.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/gallery_dl/extractor/imgbox.py b/gallery_dl/extractor/imgbox.py
index 5def88d..8ac66f4 100644
--- a/gallery_dl/extractor/imgbox.py
+++ b/gallery_dl/extractor/imgbox.py
@@ -9,7 +9,7 @@
"""Extractors for https://imgbox.com/"""
from .common import Extractor, Message, AsynchronousMixin
-from .. import text, util, exception
+from .. import text, exception
class ImgboxExtractor(Extractor):
@@ -19,7 +19,7 @@ class ImgboxExtractor(Extractor):
def items(self):
data = self.get_job_metadata()
- yield Message.Directory, data
+ yield Message.Directory, "", data
for image_key in self.get_image_keys():
imgpage = self.request(self.root + "/" + image_key).text
@@ -69,7 +69,7 @@ class ImgboxGalleryExtractor(AsynchronousMixin, ImgboxExtractor):
page = self.request(self.root + "/g/" + self.gallery_key).text
if "The specified gallery could not be found." in page:
raise exception.NotFoundError("gallery")
- self.image_keys = util.re(
+ self.image_keys = text.re(
r'<a href="/([^"]+)"><img alt="').findall(page)
title = text.extr(page, "<h1>", "</h1>")
@@ -88,7 +88,10 @@ class ImgboxImageExtractor(ImgboxExtractor):
"""Extractor for single images from imgbox.com"""
subcategory = "image"
archive_fmt = "{image_key}"
- pattern = r"(?:https?://)?(?:www\.)?imgbox\.com/([A-Za-z0-9]{8})"
+ pattern = (r"(?:https?://)?(?:"
+ r"(?:www\.|i\.)?imgbox\.com|"
+ r"images\d+\.imgbox\.com/[0-9a-f]{2}/[0-9a-f]{2}"
+ r")/([A-Za-z0-9]{8})")
example = "https://imgbox.com/1234abcd"
def __init__(self, match):