diff --git a/docs/configuration.rst b/docs/configuration.rst index 208e4028..4efd498a 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1457,6 +1457,19 @@ Description Process reposts. +extractor.bunkr.tlds +-------------------- +Type + ``bool`` +Default + ``false`` +Description + Controls which ``bunkr`` TLDs to accept. + + * ``true``: Match URLs with *all* possible TLDs (e.g. ``bunkr.xyz`` or ``bunkrrr.duck``) + * ``false``: Match only URLs with known TLDs + + extractor.cien.files -------------------- Type diff --git a/gallery_dl/extractor/bunkr.py b/gallery_dl/extractor/bunkr.py index 90c1e74b..780bdf11 100644 --- a/gallery_dl/extractor/bunkr.py +++ b/gallery_dl/extractor/bunkr.py @@ -9,13 +9,21 @@ """Extractors for https://bunkr.si/""" from .lolisafe import LolisafeAlbumExtractor -from .. import text - -BASE_PATTERN = ( - r"(?:bunkr:(?:https?://)?([^/?#]+)|" - r"(?:https?://)?(?:app\.)?(bunkr+" - r"\.(?:s[kiu]|[cf]i|ru|la|is|to|a[cx]|black|cat|media|red|site|ws|org)))" -) +from .. import text, config + + +if config.get(("extractor", "bunkr"), "tlds"): + BASE_PATTERN = ( + r"(?:bunkr:(?:https?://)?([^/?#]+)|" + r"(?:https?://)?(?:app\.)?(bunkr+\.\w+))" + ) +else: + BASE_PATTERN = ( + r"(?:bunkr:(?:https?://)?([^/?#]+)|" + r"(?:https?://)?(?:app\.)?(bunkr+" + r"\.(?:s[kiu]|[cf]i|ru|la|is|to|a[cx]" + r"|black|cat|media|red|site|ws|org)))" + ) LEGACY_DOMAINS = { "bunkr.ru",