Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
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.pyindex 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__.pyindex cd823b251..3e7025513 100644--- a/cyberdrop_dl/scraper/__init__.py+++ b/cyberdrop_dl/scraper/__init__.py@@ -6,6 +6,7 @@ from typing import TYPE_CHECKINGfrom cyberdrop_dl import __version__ as current_versionfrom cyberdrop_dl.scraper.crawlers.allporncomix_crawler import AllPornComixCrawler+from cyberdrop_dl.scraper.crawlers.bellazon_crawler import BellazonCrawlerfrom cyberdrop_dl.scraper.crawlers.bunkrr_crawler import BunkrrCrawlerfrom cyberdrop_dl.scraper.crawlers.celebforum_crawler import CelebForumCrawlerfrom cyberdrop_dl.scraper.crawlers.chevereto_crawler import CheveretoCrawlerdiff --git a/cyberdrop_dl/scraper/crawlers/allporncomix_crawler.py b/cyberdrop_dl/scraper/crawlers/allporncomix_crawler.pyindex 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 = Falsepost_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.pynew file mode 100644index 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.pyindex 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 = Noneselectors = 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_idasync 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.urlpost_number = 0post_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 + 1if len(scrape_item.url.parts) > post_part_index: