From b329e6e472763de0ec7bd3f35df62fd84a79946a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 4 Feb 2026 15:48:59 +0100 Subject: [PATCH] [xenforo] add 'attachments' & 'embeds' options --- docs/configuration.rst | 20 ++++++++++++++++++++ docs/gallery-dl.conf | 2 ++ gallery_dl/extractor/xenforo.py | 7 +++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 58e76ba6..a0d2bd7e 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -7247,6 +7247,26 @@ Description For ``Category:`` pages, recursively descent into subcategories. +extractor.[xenforo].attachments +------------------------------- +Type + ``bool`` +Default + ``true`` +Description + Extract forum post attachments. + + +extractor.[xenforo].embeds +-------------------------- +Type + ``bool`` +Default + ``true`` +Description + Extract URLs of forum post embeds. + + extractor.[xenforo].metadata ---------------------------- Type diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 4bb1184a..4f1a4d4e 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -1196,6 +1196,8 @@ "xenforo": { + "attachments": true, + "embeds" : true, "metadata" : false, "order-posts": "desc" }, diff --git a/gallery_dl/extractor/xenforo.py b/gallery_dl/extractor/xenforo.py index bc5b92de..203c3f0d 100644 --- a/gallery_dl/extractor/xenforo.py +++ b/gallery_dl/extractor/xenforo.py @@ -42,13 +42,16 @@ class XenforoExtractor(BaseExtractor): r')' ).findall + embeds = self.config("embeds", True) + attachments = self.config("attachments", True) + root = self.root base = root if (pos := root.find("/", 8)) < 0 else root[:pos] for post in self.posts(): urls = extract_urls(post["content"]) - if "data-s9e-mediaembed-iframe=" in post["content"]: + if embeds and "data-s9e-mediaembed-iframe=" in post["content"]: self._extract_embeds(urls, post) - if post["attachments"]: + if attachments and post["attachments"]: self._extract_attachments(urls, post) data = {"post": post}