diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py index 370e4fa33..4390bd9bb 100644 --- a/cyberdrop_dl/__init__.py +++ b/cyberdrop_dl/__init__.py @@ -1 +1 @@ -__version__ = "5.2.39" +__version__ = "5.2.41" diff --git a/cyberdrop_dl/scraper/crawlers/cyberfile_crawler.py b/cyberdrop_dl/scraper/crawlers/cyberfile_crawler.py index 1ca434fc2..95df66d55 100644 --- a/cyberdrop_dl/scraper/crawlers/cyberfile_crawler.py +++ b/cyberdrop_dl/scraper/crawlers/cyberfile_crawler.py @@ -8,6 +8,7 @@ from bs4 import BeautifulSoup from yarl import URL +from cyberdrop_dl.clients.errors import PasswordProtected from cyberdrop_dl.scraper.crawler import Crawler from cyberdrop_dl.utils.dataclasses.url_objects import ScrapeItem from cyberdrop_dl.utils.utilities import error_handling_wrapper, log, get_filename_and_ext @@ -145,6 +146,10 @@ async def handle_content_id(self, scrape_item: ScrapeItem, contentId: int) -> No async with self.request_limiter: ajax_dict = await self.client.post_data(self.domain, self.api_details, data=data) ajax_soup = BeautifulSoup(ajax_dict['html'].replace("\\", ""), 'html.parser') + + if "albumPasswordModel" in ajax_dict['html']: + await log(f"Album is password protected: {scrape_item.url}", 30) + raise PasswordProtected() file_menu = ajax_soup.select_one('ul[class="dropdown-menu dropdown-info account-dropdown-resize-menu"] li a') file_button = ajax_soup.select_one('div[class="btn-group responsiveMobileMargin"] button') @@ -154,7 +159,7 @@ async def handle_content_id(self, scrape_item: ScrapeItem, contentId: int) -> No html_download_text = file_button.get("onclick") link = URL(html_download_text.split("'")[1]) - file_detail_table = ajax_soup.select_one('table[class="table table-bordered table-striped"]') + file_detail_table = ajax_soup.select('table[class="table table-bordered table-striped"]')[-1] uploaded_row = file_detail_table.select('tr')[-2] uploaded_date = uploaded_row.select_one('td[class=responsiveTable]').text.strip() uploaded_date = await self.parse_datetime(uploaded_date) diff --git a/pyproject.toml b/pyproject.toml index b51d2fad6..854938ea9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cyberdrop-dl" -version = "5.2.39" +version = "5.2.41" description = "Bulk downloader for multiple file hosts" authors = ["Jules Winnfield "] readme = "README.md"