Skip to content

Bulk asynchronous downloader for multiple file hosts

Feature: Add support for bellazon.com (#440)

Jacobad630946e1af
diff --git a/cyberdrop_dl/config_definitions/authentication_settings.py b/cyberdrop_dl/config_definitions/authentication_settings.py
index d76de31d2..de5c63b87 100644
--- a/cyberdrop_dl/config_definitions/authentication_settings.py
+++ b/cyberdrop_dl/config_definitions/authentication_settings.py
@@ -7,6 +7,9 @@ class ForumAuth(BaseModel):
allporncomix_xf_user_cookie: str = ""
allporncomix_username: str = ""
allporncomix_password: str = ""
+ bellazon_xf_user_cookie: str = ""
+ bellazon_username: str = ""
+ bellazon_password: str = ""
celebforum_xf_user_cookie: str = ""
celebforum_username: str = ""
celebforum_password: str = ""
diff --git a/cyberdrop_dl/scraper/__init__.py b/cyberdrop_dl/scraper/__init__.py
index cd823b251..3e7025513 100644
--- a/cyberdrop_dl/scraper/__init__.py
+++ b/cyberdrop_dl/scraper/__init__.py
@@ -6,6 +6,7 @@ from typing import TYPE_CHECKING
from cyberdrop_dl import __version__ as current_version
from cyberdrop_dl.scraper.crawlers.allporncomix_crawler import AllPornComixCrawler
+from cyberdrop_dl.scraper.crawlers.bellazon_crawler import BellazonCrawler
from cyberdrop_dl.scraper.crawlers.bunkrr_crawler import BunkrrCrawler
from cyberdrop_dl.scraper.crawlers.celebforum_crawler import CelebForumCrawler
from cyberdrop_dl.scraper.crawlers.chevereto_crawler import CheveretoCrawler
diff --git a/cyberdrop_dl/scraper/crawlers/allporncomix_crawler.py b/cyberdrop_dl/scraper/crawlers/allporncomix_crawler.py
index d79ef01c7..82e22086b 100644
--- a/cyberdrop_dl/scraper/crawlers/allporncomix_crawler.py
+++ b/cyberdrop_dl/scraper/crawlers/allporncomix_crawler.py
@@ -13,6 +13,7 @@ if TYPE_CHECKING:
class AllPornComixCrawler(XenforoCrawler):
primary_base_domain = URL("https://forum.allporncomix.com")
domain = "allporncomix"
+ login_required = False
post_selectors = PostSelectors(
content=Selector("div[class=bbWrapper]", None),
images=Selector("img[class*=bbImage]", "data-src"),
diff --git a/cyberdrop_dl/scraper/crawlers/bellazon_crawler.py b/cyberdrop_dl/scraper/crawlers/bellazon_crawler.py
new file mode 100644
index 000000000..b67367a46
--- /dev/null
+++ b/cyberdrop_dl/scraper/crawlers/bellazon_crawler.py
@@ -0,0 +1,30 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+from yarl import URL
+
+from .xenforo_crawler import PostSelectors, Selector, XenforoCrawler, XenforoSelectors
+
+if TYPE_CHECKING:
+ from cyberdrop_dl.managers.manager import Manager
+
+
+class BellazonCrawler(XenforoCrawler):
+ primary_base_domain = URL("https://www.bellazon.com/main/")
+ domain = "bellazon"
+ thread_url_part = "topic"
+ login_required = False
+ post_selectors = PostSelectors(
+ content=Selector("div[class=cPost_contentWrap]", None),
+ images=Selector("a[class*=ipsAttachLink_image]", "href"),
+ videos=Selector("video[class=ipsEmbeddedVideo] source", "src"),
+ date=Selector("time", "datetime"),
+ )
+ selectors = XenforoSelectors(
+ posts=post_selectors,
+ title=Selector("span.ipsType_break.ipsContained span", None),
+ )
+
+ def __init__(self, manager: Manager) -> None:
+ super().__init__(manager, self.domain, "Bellazon")
diff --git a/cyberdrop_dl/scraper/crawlers/xenforo_crawler.py b/cyberdrop_dl/scraper/crawlers/xenforo_crawler.py
index 2bfb4861b..f0e0dc4cd 100644
--- a/cyberdrop_dl/scraper/crawlers/xenforo_crawler.py
+++ b/cyberdrop_dl/scraper/crawlers/xenforo_crawler.py
@@ -90,6 +90,7 @@ class XenforoCrawler(Crawler):
primary_base_domain = None
selectors = XenforoSelectors()
DEFAULT_POST_TITLE_FORMAT = "post-{number}"
+ thread_url_part = "threads"
def __init__(self, manager: Manager, site: str, folder_domain: str | None = None) -> None:
super().__init__(manager, site, folder_domain)
@@ -105,7 +106,7 @@ class XenforoCrawler(Crawler):
@create_task_id
async def fetch(self, scrape_item: ScrapeItem) -> None:
"""Determines where to send the scrape item based on the url."""
- if "threads" not in scrape_item.url.parts:
+ if self.thread_url_part not in scrape_item.url.parts:
log(f"Scrape Failed: Unknown URL path: {scrape_item.url}", 40)
return
@@ -149,7 +150,7 @@ class XenforoCrawler(Crawler):
thread_url = scrape_item.url
post_number = 0
post_sections = {scrape_item.url.fragment}
- threads_part_index = scrape_item.url.parts.index("threads")
+ threads_part_index = scrape_item.url.parts.index(self.thread_url_part)
thread_id = thread_url.parts[threads_part_index].split(".")[-1].split("#")[0]
post_part_index = threads_part_index + 1
if len(scrape_item.url.parts) > post_part_index: