Skip to content

Commit

Permalink
[bunkr] add 'tlds' option to allow URLs with all TLDs (#5875, #6017)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Aug 24, 2024
1 parent a364263 commit 46c3971
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
13 changes: 13 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 15 additions & 7 deletions gallery_dl/extractor/bunkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 46c3971

Please sign in to comment.