Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: add `get_soup_from_file` method

NTFSvolumedfc4336724d4
diff --git a/cyberdrop_dl/clients/scraper_client.py b/cyberdrop_dl/clients/scraper_client.py
index 8465f7553..7f0f82965 100644
--- a/cyberdrop_dl/clients/scraper_client.py
+++ b/cyberdrop_dl/clients/scraper_client.py
@@ -3,6 +3,7 @@ from __future__ import annotations
import json
from contextlib import asynccontextmanager
from functools import wraps
+from pathlib import Path
from typing import TYPE_CHECKING, Any
import aiohttp
@@ -244,3 +245,8 @@ class ScraperClient:
proxy=self.client_manager.proxy,
) as response:
return response.headers
+
+ def get_soup_from_file(self, path_as_str: str) -> BeautifulSoup:
+ """For testing"""
+ file_html = Path(path_as_str).read_bytes()
+ return BeautifulSoup(file_html, "html.parser")