From 9ed7d96bbe9866fcda784215286d0e4f6d909a2f Mon Sep 17 00:00:00 2001 From: Jules-WinnfieldX Date: Mon, 11 Mar 2024 10:26:51 -0600 Subject: [PATCH] fix xyz --- cyberdrop_dl/__init__.py | 2 +- cyberdrop_dl/scraper/crawlers/rule34xyz_crawler.py | 10 ++++++++-- pyproject.toml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py index a3ad17771..0b14d647a 100644 --- a/cyberdrop_dl/__init__.py +++ b/cyberdrop_dl/__init__.py @@ -1 +1 @@ -__version__ = "5.2.2" \ No newline at end of file +__version__ = "5.2.3" \ No newline at end of file diff --git a/cyberdrop_dl/scraper/crawlers/rule34xyz_crawler.py b/cyberdrop_dl/scraper/crawlers/rule34xyz_crawler.py index 2eedd1cc2..eaa99ac70 100644 --- a/cyberdrop_dl/scraper/crawlers/rule34xyz_crawler.py +++ b/cyberdrop_dl/scraper/crawlers/rule34xyz_crawler.py @@ -73,12 +73,18 @@ async def file(self, scrape_item: ScrapeItem) -> None: image = soup.select_one('img[class*="img shadow-base"]') if image: - link = self.primary_base_url.with_path(image.get('src')) + link = image.get('src') + if link.startswith("/"): + link = f"{self.primary_base_url}{link}" + link = URL(link) filename, ext = await get_filename_and_ext(link.name) await self.handle_file(link, scrape_item, filename, ext) video = soup.select_one("video source") if video: - link = self.primary_base_url.with_path(video.get('src')) + link = video.get('src') + if link.startswith("/"): + link = f"{self.primary_base_url}{link}" + link = URL(link) filename, ext = await get_filename_and_ext(link.name) await self.handle_file(link, scrape_item, filename, ext) diff --git a/pyproject.toml b/pyproject.toml index c26c68726..eed4a50ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cyberdrop-dl" -version = "5.2.2" +version = "5.2.3" description = "Bulk downloader for multiple file hosts" authors = ["Jules Winnfield "] readme = "README.md"