From da47214ca0412279ff5282b875cf8f22ae84e813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 12 Nov 2025 11:29:17 +0100 Subject: [PATCH] [bellazon] remove query parameters from attachment IDs (#8544) --- gallery_dl/extractor/bellazon.py | 3 ++- test/results/bellazon.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/bellazon.py b/gallery_dl/extractor/bellazon.py index 157699f6..4ac07b7e 100644 --- a/gallery_dl/extractor/bellazon.py +++ b/gallery_dl/extractor/bellazon.py @@ -72,7 +72,8 @@ class BellazonExtractor(Extractor): dc["extension"] = ext elif "/core/interface/file/attachment.php" in url: if not dc["id"]: - dc["id"] = url.rpartition("?id=")[2] + dc["id"] = \ + url.rpartition("?id=")[2].partition("&")[0] if name := text.extr(info, ">", "<").strip(): text.nameext_from_url(name, dc) diff --git a/test/results/bellazon.py b/test/results/bellazon.py index 3793cd41..f01c515c 100644 --- a/test/results/bellazon.py +++ b/test/results/bellazon.py @@ -223,6 +223,20 @@ __tests__ = ( "#count" : 0, }, +{ + "#url" : "https://www.bellazon.com/main/topic/4322-candids/page/1852/#comment-5902385", + "#comment" : "attachment 'id' with query parameters (#8544)", + "#class" : bellazon.BellazonPostExtractor, + "#range" : "4", + "#results" : "https://www.bellazon.com/main/applications/core/interface/file/attachment.php?id=14418097&key=491d27ee2482b1808483f1d544873b06", + + "count" : 4, + "num" : 4, + "filename" : "download", + "extension" : "jfif", + "id" : "14418097", +}, + { "#url" : "https://www.bellazon.com/main/topic/57872-millie-brady/", "#class" : bellazon.BellazonThreadExtractor,