From 096b9f1d26cf6e1de1e5785407fc945a252b7fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 10 Nov 2024 20:37:43 +0100 Subject: [PATCH] [bunkr] fix album names containing <>& unescaping HTML entities once is not good enough --- gallery_dl/extractor/bunkr.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/bunkr.py b/gallery_dl/extractor/bunkr.py index 6c79d0a5..4e0fe4e2 100644 --- a/gallery_dl/extractor/bunkr.py +++ b/gallery_dl/extractor/bunkr.py @@ -110,13 +110,17 @@ class BunkrAlbumExtractor(LolisafeAlbumExtractor): def fetch_album(self, album_id): # album metadata - page = self.request(self.root + "/a/" + self.album_id).text + page = self.request(self.root + "/a/" + album_id).text title, size = text.split_html(text.extr( page, "").partition(">")[2]) + if "&" in title: + title = title.replace( + "<", "<").replace(">", ">").replace("&", "&") + # files items = list(text.extract_iter(page, "", "")) return self._extract_files(items), { - "album_id" : self.album_id, + "album_id" : album_id, "album_name" : title, "album_size" : text.extr(size, "(", ")"), "count" : len(items),