[imgbox] match direct links (#8474)

This commit is contained in:
Mike Fährmann
2025-10-28 17:08:23 +01:00
parent fb9be55232
commit 5ab0c6051b
2 changed files with 35 additions and 1 deletions

View File

@@ -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):

View File

@@ -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",
},
)