Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
feat: add catbox and litterbox support
NTFSvolume2be49c15460c
diff --git a/cyberdrop_dl/scraper/__init__.py b/cyberdrop_dl/scraper/__init__.pyindex 2035580f0..f77c2d9d6 100644--- a/cyberdrop_dl/scraper/__init__.py+++ b/cyberdrop_dl/scraper/__init__.py@@ -8,6 +8,7 @@ from cyberdrop_dl.scraper.crawlers.allporncomix_crawler import AllPornComixCrawlfrom cyberdrop_dl.scraper.crawlers.bellazon_crawler import BellazonCrawlerfrom cyberdrop_dl.scraper.crawlers.bunkrr_albums_io_crawler import BunkrAlbumsIOCrawlerfrom cyberdrop_dl.scraper.crawlers.bunkrr_crawler import BunkrrCrawler+from cyberdrop_dl.scraper.crawlers.catbox_crawler import CatboxCrawlerfrom cyberdrop_dl.scraper.crawlers.celebforum_crawler import CelebForumCrawlerfrom cyberdrop_dl.scraper.crawlers.chevereto_crawler import CheveretoCrawlerfrom cyberdrop_dl.scraper.crawlers.coomer_crawler import CoomerCrawlerdiff --git a/cyberdrop_dl/scraper/crawlers/catbox_crawler.py b/cyberdrop_dl/scraper/crawlers/catbox_crawler.pynew file mode 100644index 000000000..a607baa52--- /dev/null+++ b/cyberdrop_dl/scraper/crawlers/catbox_crawler.py@@ -0,0 +1,36 @@+from __future__ import annotations++from typing import TYPE_CHECKING++from yarl import URL++from cyberdrop_dl.scraper.crawler import Crawler, create_task_id+from cyberdrop_dl.utils.utilities import error_handling_wrapper++if TYPE_CHECKING:+ from cyberdrop_dl.managers.manager import Manager+ from cyberdrop_dl.utils.data_enums_classes.url_objects import ScrapeItem+++CDN_HOSTS = "litter.catbox.moe", "files.catbox.moe"+++class CatboxCrawler(Crawler):+ primary_base_domain = URL("https://catbox.moe")++ def __init__(self, manager: Manager) -> None:+ super().__init__(manager, "catbox.moe", "Catbox")++ """~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"""++ @create_task_id+ async def fetch(self, scrape_item: ScrapeItem) -> None:+ """Determines where to send the scrape item based on the url."""+ if any(p == scrape_item.url.host for p in CDN_HOSTS):+ return await self.file(scrape_item)+ raise ValueError++ @error_handling_wrapper+ async def file(self, scrape_item: ScrapeItem) -> None:+ filename, ext = self.get_filename_and_ext(scrape_item.url.name, assume_ext=".zip")+ await self.handle_file(scrape_item.url, scrape_item, filename, ext)