From 5ab0c6051bc5fdacd774366f13a1b23dd301fa79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 28 Oct 2025 17:08:23 +0100 Subject: [PATCH] [imgbox] match direct links (#8474) --- gallery_dl/extractor/imgbox.py | 5 ++++- test/results/imgbox.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/imgbox.py b/gallery_dl/extractor/imgbox.py index 62c38f24..5e623521 100644 --- a/gallery_dl/extractor/imgbox.py +++ b/gallery_dl/extractor/imgbox.py @@ -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): diff --git a/test/results/imgbox.py b/test/results/imgbox.py index ed0be593..b28ca759 100644 --- a/test/results/imgbox.py +++ b/test/results/imgbox.py @@ -37,9 +37,16 @@ __tests__ = ( "#url" : "https://imgbox.com/qHhw7lpG", "#category": ("", "imgbox", "image"), "#class" : imgbox.ImgboxImageExtractor, + "#results" : "https://images3.imgbox.com/6d/9a/qHhw7lpG_o.png", + "#sha1_url" : "ee9cdea6c48ad0161c1b5f81f6b0c9110997038c", "#sha1_metadata": "dfc72310026b45f3feb4f9cada20c79b2575e1af", "#sha1_content" : "0c8768055e4e20e7c7259608b67799171b691140", + + "extension": "png", + "filename" : "test-___-___", + "image_key": "qHhw7lpG", + "num" : None, }, { @@ -49,4 +56,28 @@ __tests__ = ( "#exception": exception.NotFoundError, }, +{ + "#url" : "https://images3.imgbox.com/6d/9a/qHhw7lpG_o.png", + "#comment" : "direct link", + "#class" : imgbox.ImgboxImageExtractor, + "#results" : "https://images3.imgbox.com/6d/9a/qHhw7lpG_o.png", + + "extension": "png", + "filename" : "test-___-___", + "image_key": "qHhw7lpG", + "num" : None, +}, + +{ + "#url" : "https://i.imgbox.com/ivEi0Dgm.jpg", + "#comment" : "direct link", + "#class" : imgbox.ImgboxImageExtractor, + "#results" : "https://images3.imgbox.com/72/e9/ivEi0Dgm_o.jpg", + + "extension": "jpg", + "filename" : "3998C2F200000578-3861564-image-a-25_1477114630790", + "image_key": "ivEi0Dgm", + "num" : "1", +}, + )