[imagebam] raise 'NotFoundError' for deleted galleries

This commit is contained in:
Mike Fährmann
2026-01-18 21:46:12 +01:00
parent 8a481a5126
commit 09635352d0
2 changed files with 4 additions and 12 deletions

View File

@@ -49,7 +49,7 @@ class ImagebamGalleryExtractor(ImagebamExtractor):
example = "https://www.imagebam.com/view/GID"
def items(self):
page = self.request(self.root + self.path).text
page = self.request(self.root + self.path, notfound="gallery").text
images = self.images(page)
images.reverse()

View File

@@ -5,13 +5,11 @@
# published by the Free Software Foundation.
from gallery_dl.extractor import imagebam
from gallery_dl import exception
__tests__ = (
{
"#url" : "https://www.imagebam.com/gallery/adz2y0f9574bjpmonaismyrhtjgvey4o",
"#category": ("", "imagebam", "gallery"),
"#class" : imagebam.ImagebamGalleryExtractor,
"#sha1_url" : "76d976788ae2757ac81694736b07b72356f5c4c8",
"#sha1_metadata": "b048478b1bbba3072a7fa9fcc40630b3efad1f6c",
@@ -20,7 +18,6 @@ __tests__ = (
{
"#url" : "http://www.imagebam.com/gallery/op9dwcklwdrrguibnkoe7jxgvig30o5p",
"#category": ("", "imagebam", "gallery"),
"#class" : imagebam.ImagebamGalleryExtractor,
"#count" : 107,
"#sha1_url": "32ae6fe5dc3e4ca73ff6252e522d16473595d1d1",
@@ -28,15 +25,14 @@ __tests__ = (
{
"#url" : "http://www.imagebam.com/gallery/gsl8teckymt4vbvx1stjkyk37j70va2c",
"#category": ("", "imagebam", "gallery"),
"#comment" : "'The page could not be found'",
"#class" : imagebam.ImagebamGalleryExtractor,
"#exception": exception.HttpError,
"#exception": "NotFoundError",
},
{
"#url" : "https://www.imagebam.com/view/GA3MT1",
"#comment" : "/view/ path (#2378)",
"#category": ("", "imagebam", "gallery"),
"#class" : imagebam.ImagebamGalleryExtractor,
"#sha1_url" : "35018ce1e00a2d2825a33d3cd37857edaf804919",
"#sha1_metadata": "3a9f98178f73694c527890c0d7ca9a92b46987ba",
@@ -44,7 +40,6 @@ __tests__ = (
{
"#url" : "https://www.imagebam.com/image/94d56c502511890",
"#category": ("", "imagebam", "image"),
"#class" : imagebam.ImagebamImageExtractor,
"#sha1_url" : "5e9ba3b1451f8ded0ae3a1b84402888893915d4a",
"#sha1_metadata": "2a4380d4b57554ff793898c2d6ec60987c86d1a1",
@@ -53,14 +48,12 @@ __tests__ = (
{
"#url" : "http://images3.imagebam.com/1d/8c/44/94d56c502511890.png",
"#category": ("", "imagebam", "image"),
"#class" : imagebam.ImagebamImageExtractor,
},
{
"#url" : "https://www.imagebam.com/image/0850951366904951",
"#comment" : "NSFW (#1534)",
"#category": ("", "imagebam", "image"),
"#class" : imagebam.ImagebamImageExtractor,
"#sha1_url": "d37297b17ed1615b4311c8ed511e50ce46e4c748",
},
@@ -68,7 +61,6 @@ __tests__ = (
{
"#url" : "https://www.imagebam.com/view/ME8JOQP",
"#comment" : "/view/ path (#2378)",
"#category": ("", "imagebam", "image"),
"#class" : imagebam.ImagebamImageExtractor,
"#sha1_url" : "4dca72bbe61a0360185cf4ab2bed8265b49565b8",
"#sha1_metadata": "15a494c02fd30846b41b42a26117aedde30e4ceb",
@@ -91,7 +83,7 @@ __tests__ = (
"#url" : "https://www.imagebam.com/image/40a481151474621",
"#comment" : "deleted image (#8890)",
"#class" : imagebam.ImagebamImageExtractor,
"#exception": exception.NotFoundError,
"#exception": "NotFoundError",
},
)