Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: re-structure modules (#156)

NTFSvolume6767eb3bd221
diff --git a/cyberdrop_dl/__main__.py b/cyberdrop_dl/__main__.py
index 8bd1ebcad..80426125c 100644
--- a/cyberdrop_dl/__main__.py
+++ b/cyberdrop_dl/__main__.py
@@ -17,9 +17,9 @@ from cyberdrop_dl.logs import log_spacer, setup_console_logging, setup_file_logg
from cyberdrop_dl.managers.manager import AppData, Manager
from cyberdrop_dl.models.types import HttpURL
from cyberdrop_dl.scrape_mapper import ScrapeMapper
-from cyberdrop_dl.utils import apprise, check_latest_pypi
-from cyberdrop_dl.utils.sorting import Sorter
-from cyberdrop_dl.utils.utilities import check_partials_and_empty_folders
+from cyberdrop_dl.sorter import Sorter
+from cyberdrop_dl.updates import check_latest_pypi
+from cyberdrop_dl.utils import apprise, check_partials_and_empty_folders
logger = logging.getLogger("cyberdrop_dl")
diff --git a/cyberdrop_dl/clients/__init__.py b/cyberdrop_dl/clients/__init__.py
index 7aaabd43c..1c815d37a 100644
--- a/cyberdrop_dl/clients/__init__.py
+++ b/cyberdrop_dl/clients/__init__.py
@@ -24,8 +24,8 @@ if TYPE_CHECKING:
from curl_cffi.requests.session import HttpMethod
from cyberdrop_dl.clients import flaresolverr
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.managers.client_manager import ClientManager
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL
logger = logging.getLogger(__name__)
diff --git a/cyberdrop_dl/clients/download_client.py b/cyberdrop_dl/clients/download_client.py
index ed6dda87a..d497be86c 100644
--- a/cyberdrop_dl/clients/download_client.py
+++ b/cyberdrop_dl/clients/download_client.py
@@ -24,10 +24,10 @@ if TYPE_CHECKING:
import aiohttp
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, MediaItem
from cyberdrop_dl.managers.client_manager import ClientManager
from cyberdrop_dl.managers.manager import Manager
from cyberdrop_dl.progress import ProgressHook
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, MediaItem
logger = logging.getLogger(__name__)
diff --git a/cyberdrop_dl/clients/flaresolverr.py b/cyberdrop_dl/clients/flaresolverr.py
index 6c6bb8f24..687d720d1 100644
--- a/cyberdrop_dl/clients/flaresolverr.py
+++ b/cyberdrop_dl/clients/flaresolverr.py
@@ -12,9 +12,9 @@ from typing import TYPE_CHECKING, Any
import aiohttp
from multidict import CIMultiDict, CIMultiDictProxy
-from cyberdrop_dl.data_structures import AbsoluteHttpURL
from cyberdrop_dl.exceptions import DDOSGuardError
from cyberdrop_dl.progress.scraping import show_msg
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
if TYPE_CHECKING:
from collections.abc import Callable, Iterable, Mapping
diff --git a/cyberdrop_dl/clients/jdownloader.py b/cyberdrop_dl/clients/jdownloader.py
index bfc21265e..93cda46cb 100644
--- a/cyberdrop_dl/clients/jdownloader.py
+++ b/cyberdrop_dl/clients/jdownloader.py
@@ -15,8 +15,8 @@ if TYPE_CHECKING:
from myjdapi.myjdapi import Jddevice
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.managers.manager import Manager
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL
@dataclasses.dataclass(frozen=True, slots=True)
diff --git a/cyberdrop_dl/clients/response.py b/cyberdrop_dl/clients/response.py
index 0fc0bbffa..4a8b7fc66 100644
--- a/cyberdrop_dl/clients/response.py
+++ b/cyberdrop_dl/clients/response.py
@@ -17,9 +17,9 @@ from propcache import under_cached_property
from typing_extensions import TypeVar, override
from cyberdrop_dl.clients.flaresolverr import Solution as FlaresolverrSolution
-from cyberdrop_dl.data_structures import AbsoluteHttpURL
from cyberdrop_dl.exceptions import InvalidContentTypeError, ScrapeError
-from cyberdrop_dl.utils.utilities import parse_url
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import parse_url
if TYPE_CHECKING:
from collections.abc import AsyncIterator
diff --git a/cyberdrop_dl/config/settings.py b/cyberdrop_dl/config/settings.py
index d326e1013..8fe1d0232 100755
--- a/cyberdrop_dl/config/settings.py
+++ b/cyberdrop_dl/config/settings.py
@@ -28,8 +28,8 @@ from cyberdrop_dl.models.types import (
PathOrNone,
)
from cyberdrop_dl.models.validators import falsy_as, to_timedelta
+from cyberdrop_dl.utils import delete_empty_files_and_folders
from cyberdrop_dl.utils.strings import validate_format_string
-from cyberdrop_dl.utils.utilities import delete_empty_files_and_folders
_SORTING_COMMON_FIELDS = {
"base_dir",
diff --git a/cyberdrop_dl/crawlers/__init__.py b/cyberdrop_dl/crawlers/__init__.py
index cc6f0b5f9..b0d30f002 100644
--- a/cyberdrop_dl/crawlers/__init__.py
+++ b/cyberdrop_dl/crawlers/__init__.py
@@ -3,8 +3,8 @@ from __future__ import annotations
import re
from typing import TYPE_CHECKING, TypeVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import is_absolute_http_url, remove_trailing_slash
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import is_absolute_http_url, remove_trailing_slash
if TYPE_CHECKING:
from collections.abc import Iterable
diff --git a/cyberdrop_dl/crawlers/_chevereto.py b/cyberdrop_dl/crawlers/_chevereto.py
index 0abfb40b7..0faf661dd 100644
--- a/cyberdrop_dl/crawlers/_chevereto.py
+++ b/cyberdrop_dl/crawlers/_chevereto.py
@@ -4,17 +4,16 @@ import urllib.parse
from typing import TYPE_CHECKING, Any, ClassVar, final
from cyberdrop_dl.crawlers.crawler import Crawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import PasswordProtectedError
-from cyberdrop_dl.utils import css, json, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, json, open_graph
if TYPE_CHECKING:
from collections.abc import Generator, Mapping
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/_chibisafe.py b/cyberdrop_dl/crawlers/_chibisafe.py
index 22f7adee9..ac41b90b5 100644
--- a/cyberdrop_dl/crawlers/_chibisafe.py
+++ b/cyberdrop_dl/crawlers/_chibisafe.py
@@ -17,12 +17,12 @@ from pydantic import Field
from cyberdrop_dl.crawlers.crawler import Crawler
from cyberdrop_dl.models import AliasModel
+from cyberdrop_dl.utils import DictDataclass, error_handling_wrapper
from cyberdrop_dl.utils.dates import to_timestamp
-from cyberdrop_dl.utils.utilities import DictDataclass, error_handling_wrapper
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
@dataclasses.dataclass(slots=True)
diff --git a/cyberdrop_dl/crawlers/_fluid_player.py b/cyberdrop_dl/crawlers/_fluid_player.py
index 381078d87..ba6321358 100644
--- a/cyberdrop_dl/crawlers/_fluid_player.py
+++ b/cyberdrop_dl/crawlers/_fluid_player.py
@@ -3,14 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar, NamedTuple
from cyberdrop_dl.crawlers.crawler import Crawler
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/_forum.py b/cyberdrop_dl/crawlers/_forum.py
index de56125ab..c109b1e2e 100644
--- a/cyberdrop_dl/crawlers/_forum.py
+++ b/cyberdrop_dl/crawlers/_forum.py
@@ -20,18 +20,17 @@ from typing import TYPE_CHECKING, ClassVar, Protocol, final
from bs4 import BeautifulSoup, Tag
from cyberdrop_dl.crawlers.crawler import Crawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import LoginError, MaxChildrenError, ScrapeError
-from cyberdrop_dl.utils import css
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, is_blob_or_svg
from cyberdrop_dl.utils.dates import TimeStamp, to_timestamp
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between, is_blob_or_svg
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Iterable, Sequence
from aiohttp import ClientResponse
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
LINK_TRASH_MAPPING = {".th.": ".", ".md.": ".", "ifr": "watch"}
HTTP_REGEX_LINKS = re.compile(
diff --git a/cyberdrop_dl/crawlers/_hls.py b/cyberdrop_dl/crawlers/_hls.py
index 7caa36872..f9ba5a04c 100644
--- a/cyberdrop_dl/crawlers/_hls.py
+++ b/cyberdrop_dl/crawlers/_hls.py
@@ -12,7 +12,7 @@ if TYPE_CHECKING:
import aiohttp
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL
class HLSParser(ABC):
diff --git a/cyberdrop_dl/crawlers/_kvs.py b/cyberdrop_dl/crawlers/_kvs.py
index 6b6b2bb65..232e9daa3 100644
--- a/cyberdrop_dl/crawlers/_kvs.py
+++ b/cyberdrop_dl/crawlers/_kvs.py
@@ -7,17 +7,17 @@ import re
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures import AbsoluteHttpURL, Resolution
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between, parse_url
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, open_graph, parse_url
if TYPE_CHECKING:
from collections.abc import Sequence
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
@dataclasses.dataclass(slots=True)
diff --git a/cyberdrop_dl/crawlers/_one_manager.py b/cyberdrop_dl/crawlers/_one_manager.py
index 22ae7f5b9..de1a448c1 100644
--- a/cyberdrop_dl/crawlers/_one_manager.py
+++ b/cyberdrop_dl/crawlers/_one_manager.py
@@ -11,14 +11,13 @@ from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler
from cyberdrop_dl.exceptions import InvalidContentTypeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from bs4 import Tag
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/_tubecorporate.py b/cyberdrop_dl/crawlers/_tubecorporate.py
index d055ccee7..4e12c33bc 100644
--- a/cyberdrop_dl/crawlers/_tubecorporate.py
+++ b/cyberdrop_dl/crawlers/_tubecorporate.py
@@ -6,10 +6,10 @@ from typing import TYPE_CHECKING, Any, ClassVar, Final
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
_FORMATS: Final = "_sd.mp4", "_hq.mp4", "_hd.mp4", "_fhd.mp4"
diff --git a/cyberdrop_dl/crawlers/_yetishare.py b/cyberdrop_dl/crawlers/_yetishare.py
index 897435f70..e99feae70 100644
--- a/cyberdrop_dl/crawlers/_yetishare.py
+++ b/cyberdrop_dl/crawlers/_yetishare.py
@@ -7,11 +7,10 @@ from bs4 import BeautifulSoup
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
from cyberdrop_dl.exceptions import DDOSGuardError, PasswordProtectedError, ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/anontransfer.py b/cyberdrop_dl/crawlers/anontransfer.py
index 590faf6ec..46aeae7c9 100644
--- a/cyberdrop_dl/crawlers/anontransfer.py
+++ b/cyberdrop_dl/crawlers/anontransfer.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/anysex.py b/cyberdrop_dl/crawlers/anysex.py
index 7277145ee..0bf5a8e81 100644
--- a/cyberdrop_dl/crawlers/anysex.py
+++ b/cyberdrop_dl/crawlers/anysex.py
@@ -3,13 +3,12 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._fluid_player import FluidPlayerCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper, open_graph
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/archivebate.py b/cyberdrop_dl/crawlers/archivebate.py
index 03e4adbf0..b3e6ff8f9 100644
--- a/cyberdrop_dl/crawlers/archivebate.py
+++ b/cyberdrop_dl/crawlers/archivebate.py
@@ -3,14 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, open_graph
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/ashemaletube.py b/cyberdrop_dl/crawlers/ashemaletube.py
index 037761f1e..86694d099 100644
--- a/cyberdrop_dl/crawlers/ashemaletube.py
+++ b/cyberdrop_dl/crawlers/ashemaletube.py
@@ -5,16 +5,15 @@ from enum import StrEnum
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, m3u8
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, m3u8
if TYPE_CHECKING:
from bs4 import BeautifulSoup, Tag
- from cyberdrop_dl.data_structures.mediaprops import Resolution
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.mediaprops import Resolution
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/bandcamp.py b/cyberdrop_dl/crawlers/bandcamp.py
index b00c74dc4..e4adfc710 100644
--- a/cyberdrop_dl/crawlers/bandcamp.py
+++ b/cyberdrop_dl/crawlers/bandcamp.py
@@ -8,15 +8,14 @@ from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl import env
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, dates
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, dates, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import Generator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
SUPPORTED_FORMATS = "mp3-320", "mp3", "aac-hi", "wav", "flac", "vorbis", "aiff", "alas" # Ordered by compatibility
USE_FORMATS = tuple(dict.fromkeys((env.BANDCAMP_FORMATS).split(","))) if env.BANDCAMP_FORMATS else SUPPORTED_FORMATS
diff --git a/cyberdrop_dl/crawlers/beeg.py b/cyberdrop_dl/crawlers/beeg.py
index f991b0738..a5a0d2f18 100644
--- a/cyberdrop_dl/crawlers/beeg.py
+++ b/cyberdrop_dl/crawlers/beeg.py
@@ -5,13 +5,13 @@ from collections.abc import Generator
from typing import TYPE_CHECKING, Any, ClassVar, Literal
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import DictDataclass, error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import DictDataclass, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import Generator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_JSON_URL = AbsoluteHttpURL("https://store.externulls.com/facts/file/")
diff --git a/cyberdrop_dl/crawlers/box_dot_com.py b/cyberdrop_dl/crawlers/box_dot_com.py
index 72728b0c7..ff0a0d94e 100644
--- a/cyberdrop_dl/crawlers/box_dot_com.py
+++ b/cyberdrop_dl/crawlers/box_dot_com.py
@@ -9,14 +9,13 @@ from typing import TYPE_CHECKING, Any, ClassVar
from pydantic import Field
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
from cyberdrop_dl.models import AliasModel
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class ItemType(StrEnum):
diff --git a/cyberdrop_dl/crawlers/bunkrr.py b/cyberdrop_dl/crawlers/bunkrr.py
index 5a94f5f99..5018d5c62 100644
--- a/cyberdrop_dl/crawlers/bunkrr.py
+++ b/cyberdrop_dl/crawlers/bunkrr.py
@@ -12,17 +12,16 @@ from aiohttp import ClientConnectorError
from cyberdrop_dl.constants import FileExt
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import DDOSGuardError
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, parse_url, xor_decrypt
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph, parse_url, xor_decrypt
if TYPE_CHECKING:
from collections.abc import Callable, Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_DOWNLOAD_API_ENTRYPOINT = AbsoluteHttpURL("https://apidl.bunkr.ru/api/_001_v2")
diff --git a/cyberdrop_dl/crawlers/bunkrr_albums_io.py b/cyberdrop_dl/crawlers/bunkrr_albums_io.py
index 5ca8beafc..2055e8d99 100644
--- a/cyberdrop_dl/crawlers/bunkrr_albums_io.py
+++ b/cyberdrop_dl/crawlers/bunkrr_albums_io.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class BunkrAlbumsIOCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/buzzheavier.py b/cyberdrop_dl/crawlers/buzzheavier.py
index aa0b2229d..a73104fa8 100644
--- a/cyberdrop_dl/crawlers/buzzheavier.py
+++ b/cyberdrop_dl/crawlers/buzzheavier.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://buzzheavier.com")
diff --git a/cyberdrop_dl/crawlers/camwhores_dot_tv.py b/cyberdrop_dl/crawlers/camwhores_dot_tv.py
index 68645f9f6..c7fa2f881 100644
--- a/cyberdrop_dl/crawlers/camwhores_dot_tv.py
+++ b/cyberdrop_dl/crawlers/camwhores_dot_tv.py
@@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._kvs import KernelVideoSharingCrawler
from cyberdrop_dl.crawlers.porntrex import PorntrexCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.utils import css
if TYPE_CHECKING:
diff --git a/cyberdrop_dl/crawlers/catbox.py b/cyberdrop_dl/crawlers/catbox.py
index 9e9b6adee..60decfd4b 100644
--- a/cyberdrop_dl/crawlers/catbox.py
+++ b/cyberdrop_dl/crawlers/catbox.py
@@ -3,10 +3,10 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://catbox.moe")
diff --git a/cyberdrop_dl/crawlers/cloud_mail_ru.py b/cyberdrop_dl/crawlers/cloud_mail_ru.py
index ad40eed53..bf614bee4 100644
--- a/cyberdrop_dl/crawlers/cloud_mail_ru.py
+++ b/cyberdrop_dl/crawlers/cloud_mail_ru.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class CloudMailRuCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/cloudflare_stream.py b/cyberdrop_dl/crawlers/cloudflare_stream.py
index 7df648ae6..d57294137 100644
--- a/cyberdrop_dl/crawlers/cloudflare_stream.py
+++ b/cyberdrop_dl/crawlers/cloudflare_stream.py
@@ -9,13 +9,13 @@ import uuid
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
from cyberdrop_dl.utils.json import JSONWebToken, is_jwt
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_DEFAULT_VIDEO_CDN = AbsoluteHttpURL("https://watch.cloudflarestream.com")
diff --git a/cyberdrop_dl/crawlers/coomer.py b/cyberdrop_dl/crawlers/coomer.py
index d546a1bed..991b1f917 100644
--- a/cyberdrop_dl/crawlers/coomer.py
+++ b/cyberdrop_dl/crawlers/coomer.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .kemono import KemonoBaseCrawler
diff --git a/cyberdrop_dl/crawlers/crawler.py b/cyberdrop_dl/crawlers/crawler.py
index 574798c7a..c4814d149 100644
--- a/cyberdrop_dl/crawlers/crawler.py
+++ b/cyberdrop_dl/crawlers/crawler.py
@@ -22,21 +22,23 @@ from typing_extensions import deprecated
from cyberdrop_dl.clients import HTTPClient, HTTPClientProxy
from cyberdrop_dl.crawlers._hls import HLSParser
-from cyberdrop_dl.data_structures.mediaprops import ISO639Subtitle, Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, MediaItem, ScrapeItem
from cyberdrop_dl.downloader.downloader import Downloader
from cyberdrop_dl.exceptions import MaxChildrenError, NoExtensionError, ScrapeError
-from cyberdrop_dl.utils import css, dates, m3u8
-from cyberdrop_dl.utils.filepath import compose_filename, get_filename_and_ext, remove_file_id
-from cyberdrop_dl.utils.strings import safe_format
-from cyberdrop_dl.utils.utilities import (
+from cyberdrop_dl.mediaprops import ISO639Subtitle, Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, MediaItem, ScrapeItem
+from cyberdrop_dl.utils import (
+ css,
+ dates,
error_handling_context,
error_handling_wrapper,
get_download_path,
is_absolute_http_url,
is_blob_or_svg,
+ m3u8,
parse_url,
)
+from cyberdrop_dl.utils.filepath import compose_filename, get_filename_and_ext, remove_file_id
+from cyberdrop_dl.utils.strings import safe_format
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, AsyncIterator, Callable, Coroutine, Generator, Iterable, Mapping
diff --git a/cyberdrop_dl/crawlers/cyberdrop.py b/cyberdrop_dl/crawlers/cyberdrop.py
index 3fbdc6e16..d02e60e92 100644
--- a/cyberdrop_dl/crawlers/cyberdrop.py
+++ b/cyberdrop_dl/crawlers/cyberdrop.py
@@ -4,12 +4,11 @@ import asyncio
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_API_ENTRYPOINT = AbsoluteHttpURL("https://api.cyberdrop.cr/api/")
_PRIMARY_URL = AbsoluteHttpURL("https://cyberdrop.cr/")
diff --git a/cyberdrop_dl/crawlers/cyberfile.py b/cyberdrop_dl/crawlers/cyberfile.py
index a52274f88..bae8c54cb 100644
--- a/cyberdrop_dl/crawlers/cyberfile.py
+++ b/cyberdrop_dl/crawlers/cyberfile.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from ._yetishare import YetiShareCrawler
diff --git a/cyberdrop_dl/crawlers/desivideo.py b/cyberdrop_dl/crawlers/desivideo.py
index 85d025030..d21a19f90 100644
--- a/cyberdrop_dl/crawlers/desivideo.py
+++ b/cyberdrop_dl/crawlers/desivideo.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/dirtyship.py b/cyberdrop_dl/crawlers/dirtyship.py
index 5e7c5dac7..0387230ac 100644
--- a/cyberdrop_dl/crawlers/dirtyship.py
+++ b/cyberdrop_dl/crawlers/dirtyship.py
@@ -4,17 +4,16 @@ import json
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, parse_url
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, parse_url
if TYPE_CHECKING:
from collections.abc import Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/discourse/_discourse.py b/cyberdrop_dl/crawlers/discourse/_discourse.py
index 29859fd01..98ebe87fc 100644
--- a/cyberdrop_dl/crawlers/discourse/_discourse.py
+++ b/cyberdrop_dl/crawlers/discourse/_discourse.py
@@ -13,16 +13,15 @@ from pydantic import BaseModel
from cyberdrop_dl.crawlers._forum import MessageBoardCrawler
from cyberdrop_dl.exceptions import MaxChildrenError
-from cyberdrop_dl.utils import css
+from cyberdrop_dl.utils import css, error_handling_wrapper
from cyberdrop_dl.utils.dates import to_timestamp
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
from .models import AvailablePost, PostStream, Topic
if TYPE_CHECKING:
from collections.abc import AsyncIterable, Iterable
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
_T = TypeVar("_T")
_MAX_POSTS_PER_REQUEST = 50
diff --git a/cyberdrop_dl/crawlers/doodstream.py b/cyberdrop_dl/crawlers/doodstream.py
index b2a399af8..4d14e3f80 100644
--- a/cyberdrop_dl/crawlers/doodstream.py
+++ b/cyberdrop_dl/crawlers/doodstream.py
@@ -7,14 +7,13 @@ import time
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/dropbox.py b/cyberdrop_dl/crawlers/dropbox.py
index acb8239d4..c4e95cc99 100644
--- a/cyberdrop_dl/crawlers/dropbox.py
+++ b/cyberdrop_dl/crawlers/dropbox.py
@@ -4,14 +4,14 @@ import dataclasses
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import LoginError, ScrapeError
-from cyberdrop_dl.utils.utilities import DictDataclass, error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import DictDataclass, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_PRIMARY_URL = AbsoluteHttpURL("https://www.dropbox.com")
diff --git a/cyberdrop_dl/crawlers/e621.py b/cyberdrop_dl/crawlers/e621.py
index b35b12f6d..0c1b7fa33 100644
--- a/cyberdrop_dl/crawlers/e621.py
+++ b/cyberdrop_dl/crawlers/e621.py
@@ -5,14 +5,14 @@ from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl import __version__
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://e621.net")
diff --git a/cyberdrop_dl/crawlers/efukt.py b/cyberdrop_dl/crawlers/efukt.py
index a8fb6a0b9..716b50f39 100644
--- a/cyberdrop_dl/crawlers/efukt.py
+++ b/cyberdrop_dl/crawlers/efukt.py
@@ -4,14 +4,13 @@ from pathlib import Path
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
from cyberdrop_dl.utils.dates import to_timestamp
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://efukt.com")
diff --git a/cyberdrop_dl/crawlers/ehentai.py b/cyberdrop_dl/crawlers/ehentai.py
index 3c120231f..30278e292 100644
--- a/cyberdrop_dl/crawlers/ehentai.py
+++ b/cyberdrop_dl/crawlers/ehentai.py
@@ -5,12 +5,11 @@ from typing import TYPE_CHECKING, ClassVar
from typing_extensions import override
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/eightmuses.py b/cyberdrop_dl/crawlers/eightmuses.py
index cf686e9d1..c400d94fa 100644
--- a/cyberdrop_dl/crawlers/eightmuses.py
+++ b/cyberdrop_dl/crawlers/eightmuses.py
@@ -3,14 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
TILE_SELECTOR = "a[class*=c-tile]"
diff --git a/cyberdrop_dl/crawlers/eporner.py b/cyberdrop_dl/crawlers/eporner.py
index 0dc91c22b..fb0f49961 100644
--- a/cyberdrop_dl/crawlers/eporner.py
+++ b/cyberdrop_dl/crawlers/eporner.py
@@ -6,16 +6,15 @@ from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl import env
from cyberdrop_dl.compat import IntEnum
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
from bs4 import BeautifulSoup, Tag
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/erome.py b/cyberdrop_dl/crawlers/erome.py
index 0f73f2598..6f51c39a1 100644
--- a/cyberdrop_dl/crawlers/erome.py
+++ b/cyberdrop_dl/crawlers/erome.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper, open_graph
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/fapello.py b/cyberdrop_dl/crawlers/fapello.py
index 0f44fed5c..0f626fcad 100644
--- a/cyberdrop_dl/crawlers/fapello.py
+++ b/cyberdrop_dl/crawlers/fapello.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
CONTENT_SELECTOR = "div[id=content] a"
diff --git a/cyberdrop_dl/crawlers/fileditch.py b/cyberdrop_dl/crawlers/fileditch.py
index a19f11bd3..87ccddf36 100644
--- a/cyberdrop_dl/crawlers/fileditch.py
+++ b/cyberdrop_dl/crawlers/fileditch.py
@@ -3,13 +3,12 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
DOWNLOAD_SELECTOR = 'a.btn[href*="md5="]'
HOMEPAGE_CATCHALL_FILE = "/s21/FHVZKQyAZlIsrneDAsp.jpeg"
diff --git a/cyberdrop_dl/crawlers/files_vc.py b/cyberdrop_dl/crawlers/files_vc.py
index 7fcd37376..275e660c6 100644
--- a/cyberdrop_dl/crawlers/files_vc.py
+++ b/cyberdrop_dl/crawlers/files_vc.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
API_ENTRYPOINT = AbsoluteHttpURL("https://api.files.vc/api")
diff --git a/cyberdrop_dl/crawlers/filester.py b/cyberdrop_dl/crawlers/filester.py
index d3aa5bfe8..0b97e5ad4 100644
--- a/cyberdrop_dl/crawlers/filester.py
+++ b/cyberdrop_dl/crawlers/filester.py
@@ -4,16 +4,15 @@ import random
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, open_graph
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_CDN_URLS = AbsoluteHttpURL("https://cache1.filester.me"), AbsoluteHttpURL("https://cache6.filester.me")
diff --git a/cyberdrop_dl/crawlers/flickr.py b/cyberdrop_dl/crawlers/flickr.py
index a437d3e78..28462ddb4 100644
--- a/cyberdrop_dl/crawlers/flickr.py
+++ b/cyberdrop_dl/crawlers/flickr.py
@@ -4,14 +4,14 @@ import itertools
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_context, error_handling_wrapper, get_text_between
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_context, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class FlickrCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/fourchan.py b/cyberdrop_dl/crawlers/fourchan.py
index 3c59fa4f0..861e76b9d 100644
--- a/cyberdrop_dl/crawlers/fourchan.py
+++ b/cyberdrop_dl/crawlers/fourchan.py
@@ -5,12 +5,12 @@ from typing import TYPE_CHECKING, Any, ClassVar, NotRequired, TypedDict
from bs4 import BeautifulSoup
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_API_ENTRYPOINT = AbsoluteHttpURL("https://a.4cdn.org/")
_FILES_BASE_URL = AbsoluteHttpURL("https://i.4cdn.org/")
diff --git a/cyberdrop_dl/crawlers/fsiblog.py b/cyberdrop_dl/crawlers/fsiblog.py
index 5cf9053b5..0c342d7eb 100644
--- a/cyberdrop_dl/crawlers/fsiblog.py
+++ b/cyberdrop_dl/crawlers/fsiblog.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/fucking_fast.py b/cyberdrop_dl/crawlers/fucking_fast.py
index 986cf8b44..9d873025f 100644
--- a/cyberdrop_dl/crawlers/fucking_fast.py
+++ b/cyberdrop_dl/crawlers/fucking_fast.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class FuckingFastCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/fuxxx.py b/cyberdrop_dl/crawlers/fuxxx.py
index 7c0f5a71b..06c5a6efa 100644
--- a/cyberdrop_dl/crawlers/fuxxx.py
+++ b/cyberdrop_dl/crawlers/fuxxx.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class FuXXXCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/giphy.py b/cyberdrop_dl/crawlers/giphy.py
index 25e32a467..5cb87390d 100644
--- a/cyberdrop_dl/crawlers/giphy.py
+++ b/cyberdrop_dl/crawlers/giphy.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class GiPhyCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/girlsreleased.py b/cyberdrop_dl/crawlers/girlsreleased.py
index a349dca71..e524c5695 100644
--- a/cyberdrop_dl/crawlers/girlsreleased.py
+++ b/cyberdrop_dl/crawlers/girlsreleased.py
@@ -6,11 +6,11 @@ from typing import TYPE_CHECKING, Any, ClassVar
from pydantic import dataclasses
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
@dataclasses.dataclass(frozen=True, slots=True)
diff --git a/cyberdrop_dl/crawlers/gofile.py b/cyberdrop_dl/crawlers/gofile.py
index 40c4198e2..dbb025a1a 100644
--- a/cyberdrop_dl/crawlers/gofile.py
+++ b/cyberdrop_dl/crawlers/gofile.py
@@ -6,9 +6,9 @@ from hashlib import sha256
from typing import TYPE_CHECKING, Any, ClassVar, Literal, NotRequired, TypedDict, TypeGuard
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import FILE_HOST_ALBUM, AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.exceptions import PasswordProtectedError, ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import FILE_HOST_ALBUM, AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Iterable
diff --git a/cyberdrop_dl/crawlers/google_drive.py b/cyberdrop_dl/crawlers/google_drive.py
index 4d05c7fff..7556f2b0a 100644
--- a/cyberdrop_dl/crawlers/google_drive.py
+++ b/cyberdrop_dl/crawlers/google_drive.py
@@ -36,13 +36,12 @@ import asyncio
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
# This versions numbers and restrictions are not documented and may actually be wrong
diff --git a/cyberdrop_dl/crawlers/google_photos.py b/cyberdrop_dl/crawlers/google_photos.py
index c06cd1fd9..0f8ec9dbe 100644
--- a/cyberdrop_dl/crawlers/google_photos.py
+++ b/cyberdrop_dl/crawlers/google_photos.py
@@ -5,16 +5,15 @@ from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
@dataclass(slots=True, frozen=True)
diff --git a/cyberdrop_dl/crawlers/gupload.py b/cyberdrop_dl/crawlers/gupload.py
index f3958d36d..c117b7add 100644
--- a/cyberdrop_dl/crawlers/gupload.py
+++ b/cyberdrop_dl/crawlers/gupload.py
@@ -6,12 +6,12 @@ from pathlib import Path
from typing import TYPE_CHECKING, Any, ClassVar, Final
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between, xor_decrypt
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper, get_text_between, xor_decrypt
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_KEY: Final = b"G7#kP!2qZxV9mRwL"
diff --git a/cyberdrop_dl/crawlers/hclips.py b/cyberdrop_dl/crawlers/hclips.py
index abd01dc18..16a3ed16d 100644
--- a/cyberdrop_dl/crawlers/hclips.py
+++ b/cyberdrop_dl/crawlers/hclips.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedDomains
diff --git a/cyberdrop_dl/crawlers/hdzog.py b/cyberdrop_dl/crawlers/hdzog.py
index 301498275..09e35323a 100644
--- a/cyberdrop_dl/crawlers/hdzog.py
+++ b/cyberdrop_dl/crawlers/hdzog.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class HDZogCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/hianime.py b/cyberdrop_dl/crawlers/hianime.py
index 06c9e1f8a..c87cc227e 100644
--- a/cyberdrop_dl/crawlers/hianime.py
+++ b/cyberdrop_dl/crawlers/hianime.py
@@ -9,13 +9,12 @@ import bs4
from cyberdrop_dl.aio import WeakAsyncLocks
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
from cyberdrop_dl.crawlers.megacloud import MegaCloudCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/hitomi_la.py b/cyberdrop_dl/crawlers/hitomi_la.py
index bd90980b6..ee63809a3 100644
--- a/cyberdrop_dl/crawlers/hitomi_la.py
+++ b/cyberdrop_dl/crawlers/hitomi_la.py
@@ -9,15 +9,15 @@ from datetime import datetime, timedelta
from typing import TYPE_CHECKING, ClassVar, NamedTuple, Required, TypedDict
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
from cyberdrop_dl.utils.filepath import get_filename_and_ext
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
ALLOW_AVIF = False
diff --git a/cyberdrop_dl/crawlers/hotleak_vip.py b/cyberdrop_dl/crawlers/hotleak_vip.py
index 818f84351..e360fac7d 100644
--- a/cyberdrop_dl/crawlers/hotleak_vip.py
+++ b/cyberdrop_dl/crawlers/hotleak_vip.py
@@ -4,7 +4,7 @@ import json
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.leakedzone import LeakedZoneCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from cyberdrop_dl.utils import css
if TYPE_CHECKING:
diff --git a/cyberdrop_dl/crawlers/hotleaks_dot_tv.py b/cyberdrop_dl/crawlers/hotleaks_dot_tv.py
index 345f9a8b9..af6c61af5 100644
--- a/cyberdrop_dl/crawlers/hotleaks_dot_tv.py
+++ b/cyberdrop_dl/crawlers/hotleaks_dot_tv.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers.leakedzone import LeakedZoneCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
PRIMARY_URL = AbsoluteHttpURL("https://hotleaks.tv")
IMAGES_CDN = AbsoluteHttpURL("https://image-cdn.hotleaks.tv")
diff --git a/cyberdrop_dl/crawlers/hotmovs.py b/cyberdrop_dl/crawlers/hotmovs.py
index 8e2987df7..4b2a6c301 100644
--- a/cyberdrop_dl/crawlers/hotmovs.py
+++ b/cyberdrop_dl/crawlers/hotmovs.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class HotMovsCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/hotpic.py b/cyberdrop_dl/crawlers/hotpic.py
index 82541581f..717b738a9 100644
--- a/cyberdrop_dl/crawlers/hotpic.py
+++ b/cyberdrop_dl/crawlers/hotpic.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/http_direct.py b/cyberdrop_dl/crawlers/http_direct.py
index 1756311e1..cfac9a4b9 100644
--- a/cyberdrop_dl/crawlers/http_direct.py
+++ b/cyberdrop_dl/crawlers/http_direct.py
@@ -8,7 +8,7 @@ from cyberdrop_dl.exceptions import NoExtensionError
from cyberdrop_dl.utils.filepath import get_filename_and_ext
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class DirectHttpFile(Crawler, is_generic=True):
diff --git a/cyberdrop_dl/crawlers/iceyfile.py b/cyberdrop_dl/crawlers/iceyfile.py
index b81a38b73..f8b9aa06b 100644
--- a/cyberdrop_dl/crawlers/iceyfile.py
+++ b/cyberdrop_dl/crawlers/iceyfile.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from ._yetishare import YetiShareCrawler
diff --git a/cyberdrop_dl/crawlers/imagebam.py b/cyberdrop_dl/crawlers/imagebam.py
index d3c769017..011c9acf3 100644
--- a/cyberdrop_dl/crawlers/imagebam.py
+++ b/cyberdrop_dl/crawlers/imagebam.py
@@ -4,14 +4,13 @@ from pathlib import Path
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/imagepond.py b/cyberdrop_dl/crawlers/imagepond.py
index 90f360557..d88bb9567 100644
--- a/cyberdrop_dl/crawlers/imagepond.py
+++ b/cyberdrop_dl/crawlers/imagepond.py
@@ -4,14 +4,13 @@ import dataclasses
from typing import TYPE_CHECKING, ClassVar, Self
from cyberdrop_dl.crawlers.crawler import Crawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/imgbb.py b/cyberdrop_dl/crawlers/imgbb.py
index 2550d905e..b4925b7a8 100644
--- a/cyberdrop_dl/crawlers/imgbb.py
+++ b/cyberdrop_dl/crawlers/imgbb.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar, Final
from cyberdrop_dl.crawlers._chevereto import CheveretoCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedDomains, SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
IMAGES_CDN: Final = "i.ibb.co"
diff --git a/cyberdrop_dl/crawlers/imgbox.py b/cyberdrop_dl/crawlers/imgbox.py
index 6df62f116..f022d985a 100644
--- a/cyberdrop_dl/crawlers/imgbox.py
+++ b/cyberdrop_dl/crawlers/imgbox.py
@@ -3,10 +3,9 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import FILE_HOST_ALBUM, AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import FILE_HOST_ALBUM, AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import css, error_handling_wrapper
PRIMARY_URL = AbsoluteHttpURL("https://imgbox.com")
IMAGES_SELECTOR = "div#gallery-view-content img"
diff --git a/cyberdrop_dl/crawlers/imglike.py b/cyberdrop_dl/crawlers/imglike.py
index 385283b35..a49704201 100644
--- a/cyberdrop_dl/crawlers/imglike.py
+++ b/cyberdrop_dl/crawlers/imglike.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._chevereto import CheveretoCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
PRIMARY_URL = AbsoluteHttpURL("https://imglike.com")
diff --git a/cyberdrop_dl/crawlers/imgur.py b/cyberdrop_dl/crawlers/imgur.py
index c8504af8e..0e8aec83e 100644
--- a/cyberdrop_dl/crawlers/imgur.py
+++ b/cyberdrop_dl/crawlers/imgur.py
@@ -3,13 +3,12 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_API_ENTRYPOINT = AbsoluteHttpURL("https://api.imgur.com/3/")
_IMAGE_CDN = AbsoluteHttpURL("https://i.imgur.com")
diff --git a/cyberdrop_dl/crawlers/imx_to.py b/cyberdrop_dl/crawlers/imx_to.py
index 6a3e20d1e..61990b26f 100644
--- a/cyberdrop_dl/crawlers/imx_to.py
+++ b/cyberdrop_dl/crawlers/imx_to.py
@@ -4,12 +4,11 @@ from pathlib import Path
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/incestflix.py b/cyberdrop_dl/crawlers/incestflix.py
index 2736a9d2e..ff2acf3a5 100644
--- a/cyberdrop_dl/crawlers/incestflix.py
+++ b/cyberdrop_dl/crawlers/incestflix.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/influencer_bitches.py b/cyberdrop_dl/crawlers/influencer_bitches.py
index e424b596d..384119ba1 100644
--- a/cyberdrop_dl/crawlers/influencer_bitches.py
+++ b/cyberdrop_dl/crawlers/influencer_bitches.py
@@ -3,14 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/inporn.py b/cyberdrop_dl/crawlers/inporn.py
index 7de87eed7..5b5a2ed1b 100644
--- a/cyberdrop_dl/crawlers/inporn.py
+++ b/cyberdrop_dl/crawlers/inporn.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class InPornCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/invision/bellazon.py b/cyberdrop_dl/crawlers/invision/bellazon.py
index 127198373..6a82ae75e 100644
--- a/cyberdrop_dl/crawlers/invision/bellazon.py
+++ b/cyberdrop_dl/crawlers/invision/bellazon.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from ._invision import InvisionCrawler
diff --git a/cyberdrop_dl/crawlers/jpg5.py b/cyberdrop_dl/crawlers/jpg5.py
index 345d8c648..52ff90ee7 100644
--- a/cyberdrop_dl/crawlers/jpg5.py
+++ b/cyberdrop_dl/crawlers/jpg5.py
@@ -3,8 +3,8 @@ from __future__ import annotations
import base64
from typing import TYPE_CHECKING, ClassVar, Final
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, xor_decrypt
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import error_handling_wrapper, xor_decrypt
from ._chevereto import CheveretoCrawler
diff --git a/cyberdrop_dl/crawlers/kemono.py b/cyberdrop_dl/crawlers/kemono.py
index 0c95d0e23..14d883553 100644
--- a/cyberdrop_dl/crawlers/kemono.py
+++ b/cyberdrop_dl/crawlers/kemono.py
@@ -13,20 +13,19 @@ from typing import TYPE_CHECKING, Annotated, Any, ClassVar, Concatenate, Literal
from pydantic import BeforeValidator, Field
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import NoExtensionError, ScrapeError
from cyberdrop_dl.models import AliasModel
from cyberdrop_dl.models.validators import falsy_as, falsy_as_none
-from cyberdrop_dl.utils import css
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, remove_parts
from cyberdrop_dl.utils.dates import to_timestamp
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, remove_parts
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Callable, Coroutine, Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_P = ParamSpec("_P")
diff --git a/cyberdrop_dl/crawlers/koofr.py b/cyberdrop_dl/crawlers/koofr.py
index f4b26f006..add316a2b 100644
--- a/cyberdrop_dl/crawlers/koofr.py
+++ b/cyberdrop_dl/crawlers/koofr.py
@@ -6,9 +6,9 @@ from typing import Any, ClassVar, Literal
from pydantic import dataclasses
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.exceptions import DownloadError, PasswordProtectedError, ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import error_handling_wrapper
_APP_URL = AbsoluteHttpURL("https://app.koofr.net")
_APP_LINKS = _APP_URL / "api/v2/public/links"
diff --git a/cyberdrop_dl/crawlers/leakedzone.py b/cyberdrop_dl/crawlers/leakedzone.py
index 7f151708e..db966b49f 100644
--- a/cyberdrop_dl/crawlers/leakedzone.py
+++ b/cyberdrop_dl/crawlers/leakedzone.py
@@ -7,14 +7,13 @@ from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.compat import IntEnum
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class PostType(IntEnum):
diff --git a/cyberdrop_dl/crawlers/luscious.py b/cyberdrop_dl/crawlers/luscious.py
index 6dd457037..f2cfa9973 100644
--- a/cyberdrop_dl/crawlers/luscious.py
+++ b/cyberdrop_dl/crawlers/luscious.py
@@ -5,14 +5,14 @@ import json
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
GRAPHQL_URL = AbsoluteHttpURL("https://members.luscious.net/graphql/nobatch/")
diff --git a/cyberdrop_dl/crawlers/luxuretv.py b/cyberdrop_dl/crawlers/luxuretv.py
index 8b6f47aaa..0cea9c6a1 100644
--- a/cyberdrop_dl/crawlers/luxuretv.py
+++ b/cyberdrop_dl/crawlers/luxuretv.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/masahub.py b/cyberdrop_dl/crawlers/masahub.py
index a10dfe16a..1853d3c3b 100644
--- a/cyberdrop_dl/crawlers/masahub.py
+++ b/cyberdrop_dl/crawlers/masahub.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/mediafire.py b/cyberdrop_dl/crawlers/mediafire.py
index 1400a0398..6543a83f2 100644
--- a/cyberdrop_dl/crawlers/mediafire.py
+++ b/cyberdrop_dl/crawlers/mediafire.py
@@ -9,17 +9,16 @@ from http import HTTPStatus
from typing import TYPE_CHECKING, Any, ClassVar, Literal
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import DictDataclass, error_handling_wrapper, is_blob_or_svg
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import DictDataclass, css, error_handling_wrapper, is_blob_or_svg
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
@dataclasses.dataclass(slots=True, frozen=True)
diff --git a/cyberdrop_dl/crawlers/mega_nz.py b/cyberdrop_dl/crawlers/mega_nz.py
index a3f1b644d..5d4aab99d 100644
--- a/cyberdrop_dl/crawlers/mega_nz.py
+++ b/cyberdrop_dl/crawlers/mega_nz.py
@@ -16,15 +16,15 @@ from mega.data_structures import Crypto
from typing_extensions import override
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.downloader.mega_nz import MegaDownloader
from cyberdrop_dl.exceptions import LoginError, ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from mega.filesystem import FileSystem
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class MegaNzCrawler(Crawler, db_path="path_qs_frag"):
diff --git a/cyberdrop_dl/crawlers/megacloud.py b/cyberdrop_dl/crawlers/megacloud.py
index 1b8bca48e..7192a9944 100644
--- a/cyberdrop_dl/crawlers/megacloud.py
+++ b/cyberdrop_dl/crawlers/megacloud.py
@@ -5,13 +5,13 @@ import re
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Subtitle
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.mediaprops import Subtitle
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_PRIMARY_URL = AbsoluteHttpURL("https://megacloud.blog")
diff --git a/cyberdrop_dl/crawlers/missav.py b/cyberdrop_dl/crawlers/missav.py
index 05d2cd528..a1ca872b0 100644
--- a/cyberdrop_dl/crawlers/missav.py
+++ b/cyberdrop_dl/crawlers/missav.py
@@ -3,14 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
if TYPE_CHECKING:
from bs4 import BeautifulSoup, Tag
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_M3U8_SERVER = AbsoluteHttpURL("https://surrit.com/")
diff --git a/cyberdrop_dl/crawlers/mixdrop.py b/cyberdrop_dl/crawlers/mixdrop.py
index 3cd3b40d8..5f3e0104c 100644
--- a/cyberdrop_dl/crawlers/mixdrop.py
+++ b/cyberdrop_dl/crawlers/mixdrop.py
@@ -4,14 +4,13 @@ import asyncio
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, js_unpacker
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, js_unpacker
if TYPE_CHECKING:
from collections.abc import Generator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class MixDropCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/motherless.py b/cyberdrop_dl/crawlers/motherless.py
index 639120366..a260a3385 100644
--- a/cyberdrop_dl/crawlers/motherless.py
+++ b/cyberdrop_dl/crawlers/motherless.py
@@ -3,15 +3,14 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar, Literal, NamedTuple
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://motherless.com")
diff --git a/cyberdrop_dl/crawlers/mydesi.py b/cyberdrop_dl/crawlers/mydesi.py
index ff8754dca..acb4b5e38 100644
--- a/cyberdrop_dl/crawlers/mydesi.py
+++ b/cyberdrop_dl/crawlers/mydesi.py
@@ -4,17 +4,16 @@ import itertools
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class MyDesiCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/nekohouse.py b/cyberdrop_dl/crawlers/nekohouse.py
index 6aa868e1d..960cf8708 100644
--- a/cyberdrop_dl/crawlers/nekohouse.py
+++ b/cyberdrop_dl/crawlers/nekohouse.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .kemono import KemonoBaseCrawler
diff --git a/cyberdrop_dl/crawlers/nhentai.py b/cyberdrop_dl/crawlers/nhentai.py
index 7d91c8c73..415f226df 100644
--- a/cyberdrop_dl/crawlers/nhentai.py
+++ b/cyberdrop_dl/crawlers/nhentai.py
@@ -4,15 +4,14 @@ import random
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import LoginError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import Generator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/noodle_magazine.py b/cyberdrop_dl/crawlers/noodle_magazine.py
index 3449a7965..e20cfe79e 100644
--- a/cyberdrop_dl/crawlers/noodle_magazine.py
+++ b/cyberdrop_dl/crawlers/noodle_magazine.py
@@ -6,18 +6,17 @@ import json
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between, parse_url
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, parse_url
if TYPE_CHECKING:
from collections.abc import Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/nsfw_xxx.py b/cyberdrop_dl/crawlers/nsfw_xxx.py
index 21d8c39e5..be4e6f1ba 100644
--- a/cyberdrop_dl/crawlers/nsfw_xxx.py
+++ b/cyberdrop_dl/crawlers/nsfw_xxx.py
@@ -3,14 +3,14 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_BASE_QUERY = "nsfw[]=0&nsfw[]=1&nsfw[]=2&nsfw[]=3&nsfw[]=4"
_TYPES_QUERY = "types[]=image&types[]=video&types[]=gallery"
diff --git a/cyberdrop_dl/crawlers/nudostartv.py b/cyberdrop_dl/crawlers/nudostartv.py
index 5ce74d2ac..f15f4ca88 100644
--- a/cyberdrop_dl/crawlers/nudostartv.py
+++ b/cyberdrop_dl/crawlers/nudostartv.py
@@ -3,13 +3,12 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
IMAGE_SELECTOR = "div[class=block-video] a img"
CONTENT_SELECTOR = "div[id=list_videos_common_videos_list_items] div a"
diff --git a/cyberdrop_dl/crawlers/odnoklassniki.py b/cyberdrop_dl/crawlers/odnoklassniki.py
index 034702b12..e525ed9de 100644
--- a/cyberdrop_dl/crawlers/odnoklassniki.py
+++ b/cyberdrop_dl/crawlers/odnoklassniki.py
@@ -4,16 +4,15 @@ import re
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, json
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, json
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_find_video_ids = re.compile("/video/(\\d+)").finditer
diff --git a/cyberdrop_dl/crawlers/omegascans.py b/cyberdrop_dl/crawlers/omegascans.py
index 0af53d89d..130cd948c 100644
--- a/cyberdrop_dl/crawlers/omegascans.py
+++ b/cyberdrop_dl/crawlers/omegascans.py
@@ -4,13 +4,12 @@ import itertools
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
DATE_SELECTOR = 'h2[class="font-semibold font-sans text-muted-foreground text-xs"]'
diff --git a/cyberdrop_dl/crawlers/onedrive.py b/cyberdrop_dl/crawlers/onedrive.py
index 927bb5011..c083c48d0 100644
--- a/cyberdrop_dl/crawlers/onedrive.py
+++ b/cyberdrop_dl/crawlers/onedrive.py
@@ -10,13 +10,13 @@ from functools import partial
from typing import TYPE_CHECKING, Any, ClassVar, Self
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
from cyberdrop_dl.utils.dates import to_timestamp
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
API_ENTRYPOINT = AbsoluteHttpURL("https://api.onedrive.com/v1.0/drives/")
diff --git a/cyberdrop_dl/crawlers/onepace.py b/cyberdrop_dl/crawlers/onepace.py
index e8d073530..740f1db15 100644
--- a/cyberdrop_dl/crawlers/onepace.py
+++ b/cyberdrop_dl/crawlers/onepace.py
@@ -6,14 +6,13 @@ from pydantic import dataclasses
from cyberdrop_dl import env
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import next_js
-from cyberdrop_dl.utils.utilities import DictDataclass, error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import DictDataclass, error_handling_wrapper, next_js
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
@dataclasses.dataclass(slots=True)
diff --git a/cyberdrop_dl/crawlers/owncloud.py b/cyberdrop_dl/crawlers/owncloud.py
index 770d95c0a..f61abfacc 100644
--- a/cyberdrop_dl/crawlers/owncloud.py
+++ b/cyberdrop_dl/crawlers/owncloud.py
@@ -5,11 +5,10 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.utils import dates, webdav
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.utils import dates, error_handling_wrapper, webdav
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
class OwnCloudCrawler(Crawler, is_generic=True):
diff --git a/cyberdrop_dl/crawlers/pcloud.py b/cyberdrop_dl/crawlers/pcloud.py
index 9b0d54611..b716f492d 100644
--- a/cyberdrop_dl/crawlers/pcloud.py
+++ b/cyberdrop_dl/crawlers/pcloud.py
@@ -8,15 +8,14 @@ from typing import TYPE_CHECKING, Any, ClassVar, Literal, cast
from pydantic import TypeAdapter
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import dates
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import dates, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import Sequence
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_EU_API_URL = AbsoluteHttpURL("https://eapi.pcloud.com")
diff --git a/cyberdrop_dl/crawlers/pimp_bunny.py b/cyberdrop_dl/crawlers/pimp_bunny.py
index 2c77ed1b8..c20ae156e 100644
--- a/cyberdrop_dl/crawlers/pimp_bunny.py
+++ b/cyberdrop_dl/crawlers/pimp_bunny.py
@@ -5,12 +5,12 @@ from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers._kvs import extract_kvs_video
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures import AbsoluteHttpURL, Resolution
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.mediaprops import Resolution
+ from cyberdrop_dl.url_objects import ScrapeItem
_PER_PAGE: int = 1000
diff --git a/cyberdrop_dl/crawlers/pimpandhost.py b/cyberdrop_dl/crawlers/pimpandhost.py
index f317b6f4e..da9af00db 100644
--- a/cyberdrop_dl/crawlers/pimpandhost.py
+++ b/cyberdrop_dl/crawlers/pimpandhost.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
ALBUM_TITLE_SELECTOR = "span[class=author-header__album-name]"
DATE_SELECTOR = "span[class=date-time]"
diff --git a/cyberdrop_dl/crawlers/pixeldrain.py b/cyberdrop_dl/crawlers/pixeldrain.py
index e8b797189..4c001bd0f 100644
--- a/cyberdrop_dl/crawlers/pixeldrain.py
+++ b/cyberdrop_dl/crawlers/pixeldrain.py
@@ -8,13 +8,13 @@ from pydantic import BaseModel
from cyberdrop_dl import env
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedDomains, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from cyberdrop_dl.clients.response import AbstractResponse
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_PRIMARY_URL = AbsoluteHttpURL("https://pixeldrain.com")
diff --git a/cyberdrop_dl/crawlers/pixhost.py b/cyberdrop_dl/crawlers/pixhost.py
index 5de0162b4..f142807a8 100644
--- a/cyberdrop_dl/crawlers/pixhost.py
+++ b/cyberdrop_dl/crawlers/pixhost.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/pkmncards.py b/cyberdrop_dl/crawlers/pkmncards.py
index 86e3ad527..41f31a8c7 100644
--- a/cyberdrop_dl/crawlers/pkmncards.py
+++ b/cyberdrop_dl/crawlers/pkmncards.py
@@ -8,16 +8,15 @@ from datetime import datetime
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
from cyberdrop_dl.utils.dates import TimeStamp, to_timestamp
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
if TYPE_CHECKING:
from bs4 import Tag
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/pmvhaven.py b/cyberdrop_dl/crawlers/pmvhaven.py
index b06052e3b..f15511393 100644
--- a/cyberdrop_dl/crawlers/pmvhaven.py
+++ b/cyberdrop_dl/crawlers/pmvhaven.py
@@ -6,16 +6,15 @@ import itertools
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import nuxt
-from cyberdrop_dl.utils.utilities import DictDataclass, error_handling_wrapper
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import DictDataclass, error_handling_wrapper, nuxt
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Generator, Iterable
from typing import Any
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://pmvhaven.com")
diff --git a/cyberdrop_dl/crawlers/pornhub.py b/cyberdrop_dl/crawlers/pornhub.py
index e8e4da88e..a503440e7 100644
--- a/cyberdrop_dl/crawlers/pornhub.py
+++ b/cyberdrop_dl/crawlers/pornhub.py
@@ -7,15 +7,14 @@ from http import HTTPStatus
from typing import TYPE_CHECKING, Any, ClassVar, Literal, NamedTuple, TypedDict
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://www.pornhub.com")
MP4_NOT_AVAILABLE_SINCE = datetime.datetime(2025, 6, 25).timestamp()
diff --git a/cyberdrop_dl/crawlers/pornpics.py b/cyberdrop_dl/crawlers/pornpics.py
index b3481b0b2..5c5758f41 100644
--- a/cyberdrop_dl/crawlers/pornpics.py
+++ b/cyberdrop_dl/crawlers/pornpics.py
@@ -4,16 +4,15 @@ import itertools
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
COLLECTION_PARTS = "search", "channel", "pornstar", "tag", "category"
IMAGE_SELECTOR = "div#main a.rel-link"
diff --git a/cyberdrop_dl/crawlers/porntrex.py b/cyberdrop_dl/crawlers/porntrex.py
index 7b2ebefa1..47ab2c6b9 100644
--- a/cyberdrop_dl/crawlers/porntrex.py
+++ b/cyberdrop_dl/crawlers/porntrex.py
@@ -5,13 +5,12 @@ from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._kvs import extract_kvs_video
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/pornzog.py b/cyberdrop_dl/crawlers/pornzog.py
index e4553dfe4..9506baa73 100644
--- a/cyberdrop_dl/crawlers/pornzog.py
+++ b/cyberdrop_dl/crawlers/pornzog.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/postimg.py b/cyberdrop_dl/crawlers/postimg.py
index 2e4df3898..6f8a6fe43 100644
--- a/cyberdrop_dl/crawlers/postimg.py
+++ b/cyberdrop_dl/crawlers/postimg.py
@@ -4,12 +4,11 @@ import itertools
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class PostImgCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/ranoz.py b/cyberdrop_dl/crawlers/ranoz.py
index 5b0c280a3..a411b4bf2 100644
--- a/cyberdrop_dl/crawlers/ranoz.py
+++ b/cyberdrop_dl/crawlers/ranoz.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar, NamedTuple
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class File(NamedTuple):
diff --git a/cyberdrop_dl/crawlers/realbooru.py b/cyberdrop_dl/crawlers/realbooru.py
index b43eae2e5..d18daa9b7 100644
--- a/cyberdrop_dl/crawlers/realbooru.py
+++ b/cyberdrop_dl/crawlers/realbooru.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/realdebrid.py b/cyberdrop_dl/crawlers/realdebrid.py
index 1e39092df..b5d66a3d4 100644
--- a/cyberdrop_dl/crawlers/realdebrid.py
+++ b/cyberdrop_dl/crawlers/realdebrid.py
@@ -7,12 +7,12 @@ import re
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_PRIMARY_URL = AbsoluteHttpURL("https://real-debrid.com")
_API_ENTRYPOINT = AbsoluteHttpURL("https://api.real-debrid.com/rest/1.0")
diff --git a/cyberdrop_dl/crawlers/redgifs.py b/cyberdrop_dl/crawlers/redgifs.py
index 3f8989cbe..05e1bfe13 100644
--- a/cyberdrop_dl/crawlers/redgifs.py
+++ b/cyberdrop_dl/crawlers/redgifs.py
@@ -4,15 +4,15 @@ import dataclasses
from typing import TYPE_CHECKING, Any, ClassVar, Final
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Generator
from cyberdrop_dl.clients.response import AbstractResponse
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
# Primary URL needs `www.` to prevent redirect
PRIMARY_URL = AbsoluteHttpURL("https://www.redgifs.com/")
diff --git a/cyberdrop_dl/crawlers/rule34vault.py b/cyberdrop_dl/crawlers/rule34vault.py
index 7b2efb567..6ef96b671 100644
--- a/cyberdrop_dl/crawlers/rule34vault.py
+++ b/cyberdrop_dl/crawlers/rule34vault.py
@@ -4,12 +4,11 @@ import itertools
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/rule34video.py b/cyberdrop_dl/crawlers/rule34video.py
index 0ab16091b..168075c84 100644
--- a/cyberdrop_dl/crawlers/rule34video.py
+++ b/cyberdrop_dl/crawlers/rule34video.py
@@ -3,13 +3,12 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._kvs import KernelVideoSharingCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/rule34xxx.py b/cyberdrop_dl/crawlers/rule34xxx.py
index f13935de9..1135d7987 100644
--- a/cyberdrop_dl/crawlers/rule34xxx.py
+++ b/cyberdrop_dl/crawlers/rule34xxx.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://rule34.xxx")
diff --git a/cyberdrop_dl/crawlers/rule34xyz.py b/cyberdrop_dl/crawlers/rule34xyz.py
index 50477bd83..335e9aeb4 100644
--- a/cyberdrop_dl/crawlers/rule34xyz.py
+++ b/cyberdrop_dl/crawlers/rule34xyz.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers.rule34vault import Rule34VaultCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
PRIMARY_URL = AbsoluteHttpURL("https://rule34.xyz")
diff --git a/cyberdrop_dl/crawlers/rumble.py b/cyberdrop_dl/crawlers/rumble.py
index 27e9030e8..e70ebf9b1 100644
--- a/cyberdrop_dl/crawlers/rumble.py
+++ b/cyberdrop_dl/crawlers/rumble.py
@@ -7,16 +7,15 @@ from typing import TYPE_CHECKING, Any, ClassVar, NamedTuple
from cyberdrop_dl import aio
from cyberdrop_dl.compat import IntEnum
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution, Subtitle
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import DownloadError, ScrapeError
-from cyberdrop_dl.utils import css, m3u8
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, parse_url
+from cyberdrop_dl.mediaprops import Resolution, Subtitle
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, m3u8, parse_url
if TYPE_CHECKING:
from collections.abc import Generator, Iterable
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class LiveStatus(IntEnum):
diff --git a/cyberdrop_dl/crawlers/scrolller.py b/cyberdrop_dl/crawlers/scrolller.py
index 8b35239cf..d14f65281 100644
--- a/cyberdrop_dl/crawlers/scrolller.py
+++ b/cyberdrop_dl/crawlers/scrolller.py
@@ -4,11 +4,11 @@ import json
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
DEFAULT_QUERY = """
query SubredditQuery(
diff --git a/cyberdrop_dl/crawlers/send_now.py b/cyberdrop_dl/crawlers/send_now.py
index ace6272fc..15c8b2280 100644
--- a/cyberdrop_dl/crawlers/send_now.py
+++ b/cyberdrop_dl/crawlers/send_now.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://send.now/")
diff --git a/cyberdrop_dl/crawlers/sendvid.py b/cyberdrop_dl/crawlers/sendvid.py
index 9ed6ea9fc..5a3066c09 100644
--- a/cyberdrop_dl/crawlers/sendvid.py
+++ b/cyberdrop_dl/crawlers/sendvid.py
@@ -3,13 +3,12 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, remove_parts
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, remove_parts
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://sendvid.com/")
VIDEO_SRC_SELECTOR = "video > source#video_source"
diff --git a/cyberdrop_dl/crawlers/sex_dot_com.py b/cyberdrop_dl/crawlers/sex_dot_com.py
index 1246cb13a..34397abd5 100644
--- a/cyberdrop_dl/crawlers/sex_dot_com.py
+++ b/cyberdrop_dl/crawlers/sex_dot_com.py
@@ -4,13 +4,13 @@ import itertools
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://sex.com")
diff --git a/cyberdrop_dl/crawlers/spankbang.py b/cyberdrop_dl/crawlers/spankbang.py
index b7604ab70..8d1058b7e 100644
--- a/cyberdrop_dl/crawlers/spankbang.py
+++ b/cyberdrop_dl/crawlers/spankbang.py
@@ -4,18 +4,17 @@ import dataclasses
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, json
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, json
if TYPE_CHECKING:
from collections.abc import Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/streamable.py b/cyberdrop_dl/crawlers/streamable.py
index 4f62f6366..e112701d3 100644
--- a/cyberdrop_dl/crawlers/streamable.py
+++ b/cyberdrop_dl/crawlers/streamable.py
@@ -4,12 +4,12 @@ import json
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://streamable.com")
diff --git a/cyberdrop_dl/crawlers/streamtape.py b/cyberdrop_dl/crawlers/streamtape.py
index e1804983b..9ee95d119 100644
--- a/cyberdrop_dl/crawlers/streamtape.py
+++ b/cyberdrop_dl/crawlers/streamtape.py
@@ -3,14 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between, parse_url
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, open_graph, parse_url
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/tabootube.py b/cyberdrop_dl/crawlers/tabootube.py
index 84c0e09df..26d5143ca 100644
--- a/cyberdrop_dl/crawlers/tabootube.py
+++ b/cyberdrop_dl/crawlers/tabootube.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._kvs import KernelVideoSharingCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
diff --git a/cyberdrop_dl/crawlers/thisvid.py b/cyberdrop_dl/crawlers/thisvid.py
index 452efcd85..66d807114 100644
--- a/cyberdrop_dl/crawlers/thisvid.py
+++ b/cyberdrop_dl/crawlers/thisvid.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._kvs import KernelVideoSharingCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class ThisVidCrawler(KernelVideoSharingCrawler):
diff --git a/cyberdrop_dl/crawlers/thothub.py b/cyberdrop_dl/crawlers/thothub.py
index 807d51974..ae04b9abd 100644
--- a/cyberdrop_dl/crawlers/thothub.py
+++ b/cyberdrop_dl/crawlers/thothub.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._kvs import KernelVideoSharingCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class ThotHubCrawler(KernelVideoSharingCrawler):
diff --git a/cyberdrop_dl/crawlers/tiktok.py b/cyberdrop_dl/crawlers/tiktok.py
index a821901b3..172f1fd0c 100644
--- a/cyberdrop_dl/crawlers/tiktok.py
+++ b/cyberdrop_dl/crawlers/tiktok.py
@@ -5,14 +5,14 @@ import dataclasses
from typing import TYPE_CHECKING, Any, ClassVar, Self
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, MediaItem
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import DictDataclass, error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, MediaItem
+from cyberdrop_dl.utils import DictDataclass, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Mapping
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
from cyberdrop_dl.utils import m3u8
_PRIMARY_URL = AbsoluteHttpURL("https://www.tiktok.com/")
diff --git a/cyberdrop_dl/crawlers/tnaflix.py b/cyberdrop_dl/crawlers/tnaflix.py
index d6fea4b0d..3aa18cf60 100644
--- a/cyberdrop_dl/crawlers/tnaflix.py
+++ b/cyberdrop_dl/crawlers/tnaflix.py
@@ -3,15 +3,14 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar, NamedTuple
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://www.tnaflix.com")
diff --git a/cyberdrop_dl/crawlers/tokyomotion.py b/cyberdrop_dl/crawlers/tokyomotion.py
index ff1e75283..e167458f8 100644
--- a/cyberdrop_dl/crawlers/tokyomotion.py
+++ b/cyberdrop_dl/crawlers/tokyomotion.py
@@ -4,17 +4,16 @@ from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl import signature
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
if TYPE_CHECKING:
from collections.abc import AsyncIterator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/toonily.py b/cyberdrop_dl/crawlers/toonily.py
index d5ebc245d..9fea6e339 100644
--- a/cyberdrop_dl/crawlers/toonily.py
+++ b/cyberdrop_dl/crawlers/toonily.py
@@ -3,9 +3,8 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import FILE_HOST_PROFILE, AbsoluteHttpURL, ScrapeItem
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import FILE_HOST_PROFILE, AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import css, error_handling_wrapper
class Selector:
diff --git a/cyberdrop_dl/crawlers/tranny_one.py b/cyberdrop_dl/crawlers/tranny_one.py
index 180eb278c..b39502c9e 100644
--- a/cyberdrop_dl/crawlers/tranny_one.py
+++ b/cyberdrop_dl/crawlers/tranny_one.py
@@ -4,12 +4,11 @@ import itertools
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/transfer_it.py b/cyberdrop_dl/crawlers/transfer_it.py
index 6adb9606e..52b4e866b 100644
--- a/cyberdrop_dl/crawlers/transfer_it.py
+++ b/cyberdrop_dl/crawlers/transfer_it.py
@@ -5,14 +5,14 @@ from typing import TYPE_CHECKING, ClassVar
from mega.transfer_it import TransferItClient
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from mega.data_structures import Node
+ from mega import Node
from mega.filesystem import FileSystem
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class TransferItCrawler(Crawler, db_path="path_qs_frag"):
diff --git a/cyberdrop_dl/crawlers/transflix.py b/cyberdrop_dl/crawlers/transflix.py
index de80170e6..5d83a7fa1 100644
--- a/cyberdrop_dl/crawlers/transflix.py
+++ b/cyberdrop_dl/crawlers/transflix.py
@@ -4,12 +4,11 @@ from pathlib import Path
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, RateLimit, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_UNIX_TIMESTAMP_LENGTH: int = 10
diff --git a/cyberdrop_dl/crawlers/tubepornclassic.py b/cyberdrop_dl/crawlers/tubepornclassic.py
index 9b4f462ed..396b9f5d5 100644
--- a/cyberdrop_dl/crawlers/tubepornclassic.py
+++ b/cyberdrop_dl/crawlers/tubepornclassic.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class TubePornClassicCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/turbovid.py b/cyberdrop_dl/crawlers/turbovid.py
index ebf85be11..c8967558d 100644
--- a/cyberdrop_dl/crawlers/turbovid.py
+++ b/cyberdrop_dl/crawlers/turbovid.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/twitch.py b/cyberdrop_dl/crawlers/twitch.py
index fb54dd264..0f44570c3 100644
--- a/cyberdrop_dl/crawlers/twitch.py
+++ b/cyberdrop_dl/crawlers/twitch.py
@@ -6,15 +6,15 @@ import json
from typing import TYPE_CHECKING, Any, ClassVar, Final, Literal
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, parse_url
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper, parse_url
if TYPE_CHECKING:
from collections.abc import Generator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
from cyberdrop_dl.utils import m3u8
from cyberdrop_dl.utils.m3u8 import M3U8
diff --git a/cyberdrop_dl/crawlers/twitter.py b/cyberdrop_dl/crawlers/twitter.py
index 6315dba4f..a2730ad04 100644
--- a/cyberdrop_dl/crawlers/twitter.py
+++ b/cyberdrop_dl/crawlers/twitter.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_API_URL = AbsoluteHttpURL("https://api.fxtwitter.com")
diff --git a/cyberdrop_dl/crawlers/twitter_images.py b/cyberdrop_dl/crawlers/twitter_images.py
index 012898966..1c81ca05f 100644
--- a/cyberdrop_dl/crawlers/twitter_images.py
+++ b/cyberdrop_dl/crawlers/twitter_images.py
@@ -4,10 +4,10 @@ from pathlib import Path
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, MediaItem
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, MediaItem
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
from cyberdrop_dl.utils import m3u8
diff --git a/cyberdrop_dl/crawlers/twpornstars.py b/cyberdrop_dl/crawlers/twpornstars.py
index 398bbffde..f0eb73bf4 100644
--- a/cyberdrop_dl/crawlers/twpornstars.py
+++ b/cyberdrop_dl/crawlers/twpornstars.py
@@ -3,14 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.twitter_images import TwimgCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedDomains
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/txxx.py b/cyberdrop_dl/crawlers/txxx.py
index edb5303ef..cf70733b6 100644
--- a/cyberdrop_dl/crawlers/txxx.py
+++ b/cyberdrop_dl/crawlers/txxx.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class TXXXCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/upload_ee.py b/cyberdrop_dl/crawlers/upload_ee.py
index db5dd18ea..ecc4a2221 100644
--- a/cyberdrop_dl/crawlers/upload_ee.py
+++ b/cyberdrop_dl/crawlers/upload_ee.py
@@ -3,12 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class UploadEECrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/upornia.py b/cyberdrop_dl/crawlers/upornia.py
index 8f90cb537..33a07ec47 100644
--- a/cyberdrop_dl/crawlers/upornia.py
+++ b/cyberdrop_dl/crawlers/upornia.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class UPorniaCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/vbulletin/_vbulletin.py b/cyberdrop_dl/crawlers/vbulletin/_vbulletin.py
index b8348c2aa..6e0eb0306 100644
--- a/cyberdrop_dl/crawlers/vbulletin/_vbulletin.py
+++ b/cyberdrop_dl/crawlers/vbulletin/_vbulletin.py
@@ -14,7 +14,7 @@ if TYPE_CHECKING:
from cyberdrop_dl.crawlers._forum import Thread
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
N_POSTS_PER_PAGE = 15
diff --git a/cyberdrop_dl/crawlers/vbulletin/vipergirls.py b/cyberdrop_dl/crawlers/vbulletin/vipergirls.py
index 6a9b8e709..610541044 100644
--- a/cyberdrop_dl/crawlers/vbulletin/vipergirls.py
+++ b/cyberdrop_dl/crawlers/vbulletin/vipergirls.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers.vbulletin._vbulletin import vBulletinCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class ViperGirlsCrawler(vBulletinCrawler):
diff --git a/cyberdrop_dl/crawlers/vidara.py b/cyberdrop_dl/crawlers/vidara.py
index 3ca57a640..1ceb66935 100644
--- a/cyberdrop_dl/crawlers/vidara.py
+++ b/cyberdrop_dl/crawlers/vidara.py
@@ -4,11 +4,11 @@ from pathlib import Path
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class VidaraCrawler(Crawler, db_path="path_qs_frag"):
diff --git a/cyberdrop_dl/crawlers/vipr_dot_im.py b/cyberdrop_dl/crawlers/vipr_dot_im.py
index b06b2b181..cddf9ef8d 100644
--- a/cyberdrop_dl/crawlers/vipr_dot_im.py
+++ b/cyberdrop_dl/crawlers/vipr_dot_im.py
@@ -4,12 +4,11 @@ from pathlib import Path
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class ViprImCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/vjav.py b/cyberdrop_dl/crawlers/vjav.py
index 48fd8c66c..b993d3067 100644
--- a/cyberdrop_dl/crawlers/vjav.py
+++ b/cyberdrop_dl/crawlers/vjav.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class VJavCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/voe_sx.py b/cyberdrop_dl/crawlers/voe_sx.py
index e849edd8e..ebffa1889 100644
--- a/cyberdrop_dl/crawlers/voe_sx.py
+++ b/cyberdrop_dl/crawlers/voe_sx.py
@@ -9,18 +9,17 @@ from pathlib import Path
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths, auto_task_id
-from cyberdrop_dl.data_structures import AbsoluteHttpURL
-from cyberdrop_dl.data_structures.mediaprops import Resolution, Subtitle
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import m3u8, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, parse_url
+from cyberdrop_dl.mediaprops import Resolution, Subtitle
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper, m3u8, open_graph, parse_url
if TYPE_CHECKING:
from collections.abc import Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_find_js_redirect = re.compile(
diff --git a/cyberdrop_dl/crawlers/voyeurhit.py b/cyberdrop_dl/crawlers/voyeurhit.py
index 14598773d..87e7a3481 100644
--- a/cyberdrop_dl/crawlers/voyeurhit.py
+++ b/cyberdrop_dl/crawlers/voyeurhit.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class VoyeurHitCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/vsco.py b/cyberdrop_dl/crawlers/vsco.py
index c1f5874b0..3a3a97d0a 100644
--- a/cyberdrop_dl/crawlers/vsco.py
+++ b/cyberdrop_dl/crawlers/vsco.py
@@ -6,14 +6,13 @@ from typing import TYPE_CHECKING, Any, ClassVar
from pydantic.alias_generators import to_snake
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class VSCOCrawler(Crawler):
diff --git a/cyberdrop_dl/crawlers/vxxx.py b/cyberdrop_dl/crawlers/vxxx.py
index 1fdec950d..e923a3f27 100644
--- a/cyberdrop_dl/crawlers/vxxx.py
+++ b/cyberdrop_dl/crawlers/vxxx.py
@@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class VXXXCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/wetransfer.py b/cyberdrop_dl/crawlers/wetransfer.py
index 33588bdd9..3dd55d5ea 100644
--- a/cyberdrop_dl/crawlers/wetransfer.py
+++ b/cyberdrop_dl/crawlers/wetransfer.py
@@ -3,13 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
if TYPE_CHECKING:
from cyberdrop_dl.clients.response import AbstractResponse
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_PRIMARY_URL = AbsoluteHttpURL("https://wetransfer.com/")
_API_ENTRYPOINT = _PRIMARY_URL / "api/v4/transfers"
diff --git a/cyberdrop_dl/crawlers/wordpress/_wordpress.py b/cyberdrop_dl/crawlers/wordpress/_wordpress.py
index 61a01d851..1b00dcfdf 100644
--- a/cyberdrop_dl/crawlers/wordpress/_wordpress.py
+++ b/cyberdrop_dl/crawlers/wordpress/_wordpress.py
@@ -17,11 +17,10 @@ from bs4 import BeautifulSoup
from pydantic import BaseModel
from cyberdrop_dl.crawlers.crawler import Crawler
-from cyberdrop_dl.data_structures.url_objects import QueryDatetimeRange
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, open_graph
+from cyberdrop_dl.url_objects import QueryDatetimeRange
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
from cyberdrop_dl.utils.dates import to_timestamp
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
from .models import HTML, Category, CategorySequence, ColletionType, Post, PostSequence, Tag, TagSequence
@@ -31,7 +30,7 @@ if TYPE_CHECKING:
from pydantic.type_adapter import TypeAdapter
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
_ModelT = TypeVar("_ModelT", bound=BaseModel)
_POST_PER_REQUEST = 100
diff --git a/cyberdrop_dl/crawlers/wordpress/bestprettygirl.py b/cyberdrop_dl/crawlers/wordpress/bestprettygirl.py
index fa758c3d0..16b959d76 100644
--- a/cyberdrop_dl/crawlers/wordpress/bestprettygirl.py
+++ b/cyberdrop_dl/crawlers/wordpress/bestprettygirl.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from ._wordpress import WordPressMediaCrawler
diff --git a/cyberdrop_dl/crawlers/wordpress/everia.py b/cyberdrop_dl/crawlers/wordpress/everia.py
index 70d59997e..28f5f5539 100644
--- a/cyberdrop_dl/crawlers/wordpress/everia.py
+++ b/cyberdrop_dl/crawlers/wordpress/everia.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from ._wordpress import WordPressHTMLCrawler
diff --git a/cyberdrop_dl/crawlers/xasiat.py b/cyberdrop_dl/crawlers/xasiat.py
index 276e27bf2..e3ce21aa4 100644
--- a/cyberdrop_dl/crawlers/xasiat.py
+++ b/cyberdrop_dl/crawlers/xasiat.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._kvs import KernelVideoSharingCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
diff --git a/cyberdrop_dl/crawlers/xenforo/allporncomix.py b/cyberdrop_dl/crawlers/xenforo/allporncomix.py
index 6012cc22c..55c12f429 100644
--- a/cyberdrop_dl/crawlers/xenforo/allporncomix.py
+++ b/cyberdrop_dl/crawlers/xenforo/allporncomix.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/celebforum.py b/cyberdrop_dl/crawlers/xenforo/celebforum.py
index 8a2c1a0be..87e58991c 100644
--- a/cyberdrop_dl/crawlers/xenforo/celebforum.py
+++ b/cyberdrop_dl/crawlers/xenforo/celebforum.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/f95zone.py b/cyberdrop_dl/crawlers/xenforo/f95zone.py
index 256b8bd49..c46bbf0f7 100644
--- a/cyberdrop_dl/crawlers/xenforo/f95zone.py
+++ b/cyberdrop_dl/crawlers/xenforo/f95zone.py
@@ -2,8 +2,8 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/leakedmodels.py b/cyberdrop_dl/crawlers/xenforo/leakedmodels.py
index 5b1b70900..c235e5a9a 100644
--- a/cyberdrop_dl/crawlers/xenforo/leakedmodels.py
+++ b/cyberdrop_dl/crawlers/xenforo/leakedmodels.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/nudostar.py b/cyberdrop_dl/crawlers/xenforo/nudostar.py
index 96b394837..6fbbab6b2 100644
--- a/cyberdrop_dl/crawlers/xenforo/nudostar.py
+++ b/cyberdrop_dl/crawlers/xenforo/nudostar.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/simpcity.py b/cyberdrop_dl/crawlers/xenforo/simpcity.py
index 0b2d44443..108f42299 100644
--- a/cyberdrop_dl/crawlers/xenforo/simpcity.py
+++ b/cyberdrop_dl/crawlers/xenforo/simpcity.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/socialmediagirls.py b/cyberdrop_dl/crawlers/xenforo/socialmediagirls.py
index 4fe5f8c07..ae9989357 100644
--- a/cyberdrop_dl/crawlers/xenforo/socialmediagirls.py
+++ b/cyberdrop_dl/crawlers/xenforo/socialmediagirls.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/titsintops.py b/cyberdrop_dl/crawlers/xenforo/titsintops.py
index 7d9ec398d..61eeceb97 100644
--- a/cyberdrop_dl/crawlers/xenforo/titsintops.py
+++ b/cyberdrop_dl/crawlers/xenforo/titsintops.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from cyberdrop_dl.utils import css
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/xbunker.py b/cyberdrop_dl/crawlers/xenforo/xbunker.py
index dd4320249..3b57bbbff 100644
--- a/cyberdrop_dl/crawlers/xenforo/xbunker.py
+++ b/cyberdrop_dl/crawlers/xenforo/xbunker.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import ClassVar
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from .xenforo import XenforoCrawler
diff --git a/cyberdrop_dl/crawlers/xenforo/xenforo.py b/cyberdrop_dl/crawlers/xenforo/xenforo.py
index 17f523ec1..c0f9fe15c 100644
--- a/cyberdrop_dl/crawlers/xenforo/xenforo.py
+++ b/cyberdrop_dl/crawlers/xenforo/xenforo.py
@@ -17,16 +17,15 @@ from typing import TYPE_CHECKING, ClassVar
from bs4 import BeautifulSoup
from cyberdrop_dl.crawlers._forum import HTMLMessageBoardCrawler, MessageBoardSelectors, PostSelectors
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import LoginError, ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import Iterable, Sequence
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL
Selector = css.CssAttributeSelector
diff --git a/cyberdrop_dl/crawlers/xgroovy.py b/cyberdrop_dl/crawlers/xgroovy.py
index 5006bbfad..46b78b27d 100644
--- a/cyberdrop_dl/crawlers/xgroovy.py
+++ b/cyberdrop_dl/crawlers/xgroovy.py
@@ -3,14 +3,13 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers._fluid_player import FluidPlayerCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper, open_graph
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import SupportedPaths
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selectors:
diff --git a/cyberdrop_dl/crawlers/xhamster.py b/cyberdrop_dl/crawlers/xhamster.py
index 97277973d..8a5242ab1 100644
--- a/cyberdrop_dl/crawlers/xhamster.py
+++ b/cyberdrop_dl/crawlers/xhamster.py
@@ -9,15 +9,15 @@ from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.compat import IntEnum
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.mediaprops import Resolution
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between, parse_url, xor_decrypt
+from cyberdrop_dl.mediaprops import Resolution
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import error_handling_wrapper, get_text_between, parse_url, xor_decrypt
if TYPE_CHECKING:
from collections.abc import Callable, Iterable
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_PRIMARY_URL = AbsoluteHttpURL("https://xhamster.com/")
_ALLOW_AV1 = False
diff --git a/cyberdrop_dl/crawlers/xmilf.py b/cyberdrop_dl/crawlers/xmilf.py
index 9bbb8d3d8..7c947bc4d 100644
--- a/cyberdrop_dl/crawlers/xmilf.py
+++ b/cyberdrop_dl/crawlers/xmilf.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import ClassVar
from cyberdrop_dl.crawlers._tubecorporate import TubeCorporateCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
class XMilfCrawler(TubeCorporateCrawler):
diff --git a/cyberdrop_dl/crawlers/xvideos.py b/cyberdrop_dl/crawlers/xvideos.py
index b50d37dba..a18780fc4 100644
--- a/cyberdrop_dl/crawlers/xvideos.py
+++ b/cyberdrop_dl/crawlers/xvideos.py
@@ -7,15 +7,14 @@ from collections import defaultdict
from typing import TYPE_CHECKING, Any, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
_ACCOUNTS = ("amateurs", "profiles", "channels", "pornstars")
diff --git a/cyberdrop_dl/crawlers/xxxbunker.py b/cyberdrop_dl/crawlers/xxxbunker.py
index 390d944a8..de533a693 100644
--- a/cyberdrop_dl/crawlers/xxxbunker.py
+++ b/cyberdrop_dl/crawlers/xxxbunker.py
@@ -3,15 +3,14 @@ from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import ScrapeError
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, open_graph
if TYPE_CHECKING:
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
class Selector:
diff --git a/cyberdrop_dl/crawlers/yandex_disk.py b/cyberdrop_dl/crawlers/yandex_disk.py
index 341b7bebf..0e8065a29 100644
--- a/cyberdrop_dl/crawlers/yandex_disk.py
+++ b/cyberdrop_dl/crawlers/yandex_disk.py
@@ -7,18 +7,17 @@ from functools import cached_property
from typing import TYPE_CHECKING, Any, ClassVar, Literal, Self
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedDomains, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import DDOSGuardError, DownloadError, ScrapeError
-from cyberdrop_dl.utils import css
-from cyberdrop_dl.utils.utilities import error_handling_wrapper
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Generator
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
from cyberdrop_dl.downloader.mega_nz import AnyDict
+ from cyberdrop_dl.url_objects import ScrapeItem
JS_SELECTOR = "script#store-prefetch"
diff --git a/cyberdrop_dl/crawlers/youjizz.py b/cyberdrop_dl/crawlers/youjizz.py
index 86dbdc9fe..8ccee28ab 100644
--- a/cyberdrop_dl/crawlers/youjizz.py
+++ b/cyberdrop_dl/crawlers/youjizz.py
@@ -5,16 +5,15 @@ import json
from typing import TYPE_CHECKING, Any, ClassVar, NamedTuple
from cyberdrop_dl.crawlers.crawler import Crawler, SupportedPaths
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
-from cyberdrop_dl.utils import css, open_graph
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_text_between
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.utils import css, error_handling_wrapper, get_text_between, open_graph
if TYPE_CHECKING:
from collections.abc import Iterable
from bs4 import BeautifulSoup
- from cyberdrop_dl.data_structures.url_objects import ScrapeItem
+ from cyberdrop_dl.url_objects import ScrapeItem
PRIMARY_URL = AbsoluteHttpURL("https://www.youjizz.com/")
JS_SELECTOR = "div#content > script:-soup-contains('var dataEncodings')"
diff --git a/cyberdrop_dl/data_structures/__init__.py b/cyberdrop_dl/data_structures/__init__.py
deleted file mode 100644
index cb344cf1e..000000000
--- a/cyberdrop_dl/data_structures/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from .mediaprops import Codecs, Resolution
-from .url_objects import AbsoluteHttpURL, HlsSegment, MediaItem, QueryDatetimeRange, ScrapeItem, ScrapeItemType
-
-__all__ = [
- "AbsoluteHttpURL",
- "Codecs",
- "HlsSegment",
- "MediaItem",
- "QueryDatetimeRange",
- "Resolution",
- "ScrapeItem",
- "ScrapeItemType",
-]
diff --git a/cyberdrop_dl/database/tables/history.py b/cyberdrop_dl/database/tables/history.py
index 0480a2b38..2d73d4669 100644
--- a/cyberdrop_dl/database/tables/history.py
+++ b/cyberdrop_dl/database/tables/history.py
@@ -14,8 +14,8 @@ if TYPE_CHECKING:
import aiosqlite
from yarl import URL
- from cyberdrop_dl.data_structures.url_objects import MediaItem
from cyberdrop_dl.database import Database
+ from cyberdrop_dl.url_objects import MediaItem
_FETCH_MANY_SIZE: int = 1000
diff --git a/cyberdrop_dl/downloader/downloader.py b/cyberdrop_dl/downloader/downloader.py
index 550c38770..5f810300f 100644
--- a/cyberdrop_dl/downloader/downloader.py
+++ b/cyberdrop_dl/downloader/downloader.py
@@ -10,7 +10,6 @@ from typing import TYPE_CHECKING, NamedTuple
from aiohttp import ClientConnectorError, ClientError, ClientResponseError
from cyberdrop_dl import aio, constants, ffmpeg, storage
-from cyberdrop_dl.data_structures.url_objects import HlsSegment, MediaItem
from cyberdrop_dl.exceptions import (
DownloadError,
DurationError,
@@ -22,8 +21,8 @@ from cyberdrop_dl.exceptions import (
SkipDownloadError,
TooManyCrawlerErrors,
)
-from cyberdrop_dl.utils import dates
-from cyberdrop_dl.utils.utilities import error_handling_wrapper, parse_url
+from cyberdrop_dl.url_objects import HlsSegment, MediaItem
+from cyberdrop_dl.utils import dates, error_handling_wrapper, parse_url
logger = logging.getLogger(__name__)
diff --git a/cyberdrop_dl/downloader/mega_nz.py b/cyberdrop_dl/downloader/mega_nz.py
index b552ca4ab..224f06b79 100644
--- a/cyberdrop_dl/downloader/mega_nz.py
+++ b/cyberdrop_dl/downloader/mega_nz.py
@@ -15,9 +15,9 @@ if TYPE_CHECKING:
from mega.data_structures import Crypto
from yarl import URL
- from cyberdrop_dl.data_structures.url_objects import MediaItem
from cyberdrop_dl.managers.manager import Manager
from cyberdrop_dl.progress import ProgressHook
+ from cyberdrop_dl.url_objects import MediaItem
@final
diff --git a/cyberdrop_dl/exceptions.py b/cyberdrop_dl/exceptions.py
index ab4841595..31cc823f3 100644
--- a/cyberdrop_dl/exceptions.py
+++ b/cyberdrop_dl/exceptions.py
@@ -10,7 +10,7 @@ from yarl import URL
if TYPE_CHECKING:
from yaml import YAMLError
- from cyberdrop_dl.data_structures.url_objects import MediaItem, ScrapeItem
+ from cyberdrop_dl.url_objects import MediaItem, ScrapeItem
def _format_error(ui_failure: str, message: str) -> str:
diff --git a/cyberdrop_dl/ffmpeg.py b/cyberdrop_dl/ffmpeg.py
index 6f3503764..5972a21b5 100644
--- a/cyberdrop_dl/ffmpeg.py
+++ b/cyberdrop_dl/ffmpeg.py
@@ -14,12 +14,12 @@ from typing import TYPE_CHECKING, Any, Literal, Self, TypeAlias, TypedDict, over
from multidict import CIMultiDict, CIMultiDictProxy
-from cyberdrop_dl.utils.utilities import DictDataclass
+from cyberdrop_dl.utils import DictDataclass
if TYPE_CHECKING:
from collections.abc import Generator, Iterable, Iterator, Mapping
- from cyberdrop_dl.data_structures import AbsoluteHttpURL
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL
_CMD: TypeAlias = Iterable[str | Path]
@@ -378,7 +378,14 @@ class SubProcessResult:
def __json__(self) -> dict[str, Any]:
joined_command = " ".join(map(str, self.command))
- return dataclasses.asdict(self) | {"command": joined_command}
+ me = dataclasses.asdict(self) | {"command": joined_command}
+ try:
+ stdout = json.loads(self.stdout)
+ except json.JSONDecodeError:
+ pass
+ else:
+ me["stdout"] = stdout
+ return me
def __str__(self) -> str:
return str(self.__json__())
diff --git a/cyberdrop_dl/hasher.py b/cyberdrop_dl/hasher.py
index 673bcad31..714225572 100644
--- a/cyberdrop_dl/hasher.py
+++ b/cyberdrop_dl/hasher.py
@@ -20,8 +20,8 @@ if TYPE_CHECKING:
from yarl import URL
from cyberdrop_dl.config.settings import DupeCleanup
- from cyberdrop_dl.data_structures.url_objects import MediaItem
from cyberdrop_dl.managers.manager import Manager
+ from cyberdrop_dl.url_objects import MediaItem
_HASHERS: Final = {
diff --git a/cyberdrop_dl/managers/client_manager.py b/cyberdrop_dl/managers/client_manager.py
index 7c0bd78ef..350dabf9b 100644
--- a/cyberdrop_dl/managers/client_manager.py
+++ b/cyberdrop_dl/managers/client_manager.py
@@ -25,9 +25,9 @@ from cyberdrop_dl.clients.flaresolverr import FlareSolverrClient
from cyberdrop_dl.clients.response import AbstractResponse
from cyberdrop_dl.constants import FileExt
from cyberdrop_dl.cookies import export_cookies, extract_cookies, read_netscape_files
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, MediaItem
from cyberdrop_dl.exceptions import DDOSGuardError, DownloadError, ScrapeError, TooManyCrawlerErrors
from cyberdrop_dl.ffmpeg import probe
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, MediaItem
if TYPE_CHECKING:
from collections.abc import Callable, Generator, Iterable, Mapping
diff --git a/cyberdrop_dl/managers/logs.py b/cyberdrop_dl/managers/logs.py
index 4e4814e4d..9b72c1e16 100644
--- a/cyberdrop_dl/managers/logs.py
+++ b/cyberdrop_dl/managers/logs.py
@@ -17,8 +17,8 @@ if TYPE_CHECKING:
from yarl import URL
- from cyberdrop_dl.data_structures.url_objects import MediaItem
from cyberdrop_dl.managers.manager import Manager
+ from cyberdrop_dl.url_objects import MediaItem
logger = logging.getLogger(__name__)
diff --git a/cyberdrop_dl/managers/manager.py b/cyberdrop_dl/managers/manager.py
index 81486bb1f..f427ce7e2 100644
--- a/cyberdrop_dl/managers/manager.py
+++ b/cyberdrop_dl/managers/manager.py
@@ -17,18 +17,18 @@ from cyberdrop_dl.hasher import Hasher
from cyberdrop_dl.logs import capture_logs, log_spacer
from cyberdrop_dl.managers.client_manager import ClientManager
from cyberdrop_dl.managers.logs import LogManager
-from cyberdrop_dl.utils.utilities import get_system_information
+from cyberdrop_dl.utils import get_system_information
if TYPE_CHECKING:
from collections.abc import Sequence
from os import PathLike
- from cyberdrop_dl.data_structures.url_objects import MediaItem
from cyberdrop_dl.progress.dedupe import DedupeStats
from cyberdrop_dl.progress.hashing import HashingStats
from cyberdrop_dl.progress.scraping.errors import Error
from cyberdrop_dl.progress.sorting import SortStats
from cyberdrop_dl.scrape_mapper import ScrapeMapper, ScrapeStats
+ from cyberdrop_dl.url_objects import MediaItem
logger = logging.getLogger(__name__)
diff --git a/cyberdrop_dl/data_structures/mediaprops.py b/cyberdrop_dl/mediaprops.py
similarity index 98%
rename from cyberdrop_dl/data_structures/mediaprops.py
rename to cyberdrop_dl/mediaprops.py
index 0a4b26673..95c33ad9d 100644
--- a/cyberdrop_dl/data_structures/mediaprops.py
+++ b/cyberdrop_dl/mediaprops.py
@@ -11,7 +11,7 @@ if TYPE_CHECKING:
import yarl
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL
VIDEO_CODECS = "avc1", "avc2", "avc3", "avc4", "av1", "hevc", "hev1", "hev2", "hvc1", "hvc2", "vp8", "vp9", "vp10"
diff --git a/cyberdrop_dl/models/types.py b/cyberdrop_dl/models/types.py
index 1d684c8ec..e06a1c2d6 100755
--- a/cyberdrop_dl/models/types.py
+++ b/cyberdrop_dl/models/types.py
@@ -14,7 +14,6 @@ from pydantic import (
StringConstraints,
)
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.models.validators import (
bytesize_to_str,
change_path_suffix,
@@ -22,6 +21,7 @@ from cyberdrop_dl.models.validators import (
falsy_as_none,
to_yarl_url,
)
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
# ~~~~~ Strings ~~~~~~~
NonEmptyStr = Annotated[str, StringConstraints(min_length=1, strip_whitespace=True)]
diff --git a/cyberdrop_dl/models/validators.py b/cyberdrop_dl/models/validators.py
index c53a72017..326dc1e3b 100755
--- a/cyberdrop_dl/models/validators.py
+++ b/cyberdrop_dl/models/validators.py
@@ -27,7 +27,7 @@ def bytesize_to_str(value: _ConvertibleToInt) -> str:
def to_yarl_url(value: object) -> yarl.URL:
- from cyberdrop_dl.utils.utilities import parse_url
+ from cyberdrop_dl.utils import parse_url
try:
return parse_url(str(value))
diff --git a/cyberdrop_dl/program_ui.py b/cyberdrop_dl/program_ui.py
index b22063c3d..84a4d8b47 100644
--- a/cyberdrop_dl/program_ui.py
+++ b/cyberdrop_dl/program_ui.py
@@ -17,8 +17,8 @@ from rich.text import Text
from cyberdrop_dl import __version__
from cyberdrop_dl.hasher import hash_directory_scanner
from cyberdrop_dl.progress import hyperlink
+from cyberdrop_dl.sorter import Sorter
from cyberdrop_dl.utils import text_editor
-from cyberdrop_dl.utils.sorting import Sorter
if TYPE_CHECKING:
from collections.abc import Callable, Iterable
diff --git a/cyberdrop_dl/scrape_mapper.py b/cyberdrop_dl/scrape_mapper.py
index 00e908cbf..29e2aa559 100644
--- a/cyberdrop_dl/scrape_mapper.py
+++ b/cyberdrop_dl/scrape_mapper.py
@@ -21,12 +21,11 @@ from cyberdrop_dl.crawlers.discourse import DiscourseCrawler
from cyberdrop_dl.crawlers.http_direct import DirectHttpFile
from cyberdrop_dl.crawlers.realdebrid import RealDebridCrawler
from cyberdrop_dl.crawlers.wordpress import WordPressHTMLCrawler, WordPressMediaCrawler
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.exceptions import JDownloaderError, NoExtensionError
from cyberdrop_dl.logs import log_spacer
from cyberdrop_dl.progress.scraping import ScrapingUI
-from cyberdrop_dl.utils import filepath
-from cyberdrop_dl.utils.utilities import get_download_path, remove_trailing_slash
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import filepath, get_download_path, remove_trailing_slash
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Coroutine, Generator, Iterable, Iterator, Sequence
diff --git a/cyberdrop_dl/utils/sorting.py b/cyberdrop_dl/sorter.py
similarity index 98%
rename from cyberdrop_dl/utils/sorting.py
rename to cyberdrop_dl/sorter.py
index 388988b37..26857fcd7 100644
--- a/cyberdrop_dl/utils/sorting.py
+++ b/cyberdrop_dl/sorter.py
@@ -15,8 +15,7 @@ import imagesize
from cyberdrop_dl import aio, ffmpeg
from cyberdrop_dl.constants import FileExt, TempExt
from cyberdrop_dl.progress.sorting import SortingUI
-from cyberdrop_dl.utils import strings
-from cyberdrop_dl.utils.utilities import delete_empty_files_and_folders
+from cyberdrop_dl.utils import delete_empty_files_and_folders, strings
if TYPE_CHECKING:
from cyberdrop_dl.managers.manager import Manager
diff --git a/cyberdrop_dl/storage/__init__.py b/cyberdrop_dl/storage/__init__.py
index 6fab91ce3..5389234db 100644
--- a/cyberdrop_dl/storage/__init__.py
+++ b/cyberdrop_dl/storage/__init__.py
@@ -15,7 +15,7 @@ if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Awaitable, Callable
from pathlib import Path
- from cyberdrop_dl.data_structures import MediaItem
+ from cyberdrop_dl.url_objects import MediaItem
_required_free_space: ContextVar[int] = ContextVar("_required_free_space")
diff --git a/cyberdrop_dl/updates.py b/cyberdrop_dl/updates.py
new file mode 100644
index 000000000..baaadf843
--- /dev/null
+++ b/cyberdrop_dl/updates.py
@@ -0,0 +1,45 @@
+from __future__ import annotations
+
+import logging
+from typing import Any
+
+import aiohttp
+
+from cyberdrop_dl import __version__ as current
+
+_PYPI_JSON_URL = "https://pypi.org/pypi/cyberdrop-dl-patched/json"
+logger = logging.getLogger(__name__)
+
+
+async def check_latest_pypi() -> None:
+ logger.info("Checking for updates...")
+ try:
+ contents = await _request_pypi_info()
+
+ except Exception as e:
+ logger.error(f"Unable to get latest version information {e!r}")
+ raise
+ else:
+ _parse_pypi_resp(contents)
+
+
+async def _request_pypi_info() -> dict[str, Any]:
+ async with aiohttp.request(
+ "GET",
+ _PYPI_JSON_URL,
+ raise_for_status=True,
+ timeout=aiohttp.ClientTimeout(sock_read=30, sock_connect=20),
+ ) as response:
+ return await response.json()
+
+
+def _parse_pypi_resp(data: dict[str, Any]) -> None:
+ latest: str = data["info"]["version"]
+ releases: set[str] = set(data["releases"])
+
+ if current not in releases:
+ logger.warning(f"You are using an unreleased version of CDL: {current}. Latest stable release {latest}")
+ elif current == latest:
+ logger.info(f"You are using the latest version of CDL: {current}")
+ else:
+ logger.warning(f"A new version is available: {latest}")
diff --git a/cyberdrop_dl/data_structures/url_objects.py b/cyberdrop_dl/url_objects.py
similarity index 99%
rename from cyberdrop_dl/data_structures/url_objects.py
rename to cyberdrop_dl/url_objects.py
index 89ebd4003..f32fcbf2a 100644
--- a/cyberdrop_dl/data_structures/url_objects.py
+++ b/cyberdrop_dl/url_objects.py
@@ -345,7 +345,7 @@ class ScrapeItem:
add_parent: AbsoluteHttpURL | bool | None = None,
) -> Self:
"""Creates a scrape item."""
- from cyberdrop_dl.utils.utilities import is_absolute_http_url
+ from cyberdrop_dl.utils import is_absolute_http_url
scrape_item = self.copy()
assert is_absolute_http_url(url)
diff --git a/cyberdrop_dl/utils/__init__.py b/cyberdrop_dl/utils/__init__.py
index baaadf843..3d3f8df2b 100644
--- a/cyberdrop_dl/utils/__init__.py
+++ b/cyberdrop_dl/utils/__init__.py
@@ -1,45 +1,391 @@
from __future__ import annotations
+import contextlib
+import dataclasses
+import functools
+import inspect
+import itertools
import logging
-from typing import Any
+import os
+import platform
+import re
+import sys
+from http import HTTPStatus
+from pathlib import Path
+from typing import TYPE_CHECKING, Any, ClassVar, Concatenate, ParamSpec, Protocol, Self, TypeVar, cast, overload
-import aiohttp
+import yarl
+from aiohttp import ClientConnectorError, TooManyRedirects
+from mega.errors import MegaNzError
+from pydantic import ValidationError
+from typing_extensions import TypeIs
+
+from cyberdrop_dl.constants import TempExt
+from cyberdrop_dl.exceptions import (
+ CDLBaseError,
+ ErrorLogMessage,
+ InvalidURLError,
+ TooManyCrawlerErrors,
+ create_error_msg,
+ get_origin,
+)
+
+if TYPE_CHECKING:
+ from collections.abc import Callable, Coroutine, Generator
+
+ from cyberdrop_dl.downloader.downloader import Downloader
+ from cyberdrop_dl.managers.manager import Manager
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL, MediaItem, ScrapeItem
+
+ class _HasManager(Protocol):
+ manager: Manager
+
+ _HasManagerT = TypeVar("_HasManagerT", bound=_HasManager)
+ _Origin = TypeVar("_Origin", bound=ScrapeItem | MediaItem | yarl.URL)
+
+_P = ParamSpec("_P")
+_R = TypeVar("_R")
+
+
+class Dataclass(Protocol):
+ __dataclass_fields__: ClassVar[dict[str, Any]]
-from cyberdrop_dl import __version__ as current
-_PYPI_JSON_URL = "https://pypi.org/pypi/cyberdrop-dl-patched/json"
logger = logging.getLogger(__name__)
-async def check_latest_pypi() -> None:
- logger.info("Checking for updates...")
+_FIELDS_CACHE: dict[type, tuple[str, ...]] = {}
+
+
+def _fields(cls: type) -> tuple[str, ...]:
+ if fields := _FIELDS_CACHE.get(cls):
+ return fields
+ fields = _FIELDS_CACHE[cls] = tuple(f.name for f in dataclasses.fields(cls))
+ return fields
+
+
+class DictDataclass(Dataclass, Protocol):
+ @classmethod
+ def filter_dict(cls, data: dict[str, Any], /) -> dict[str, Any]:
+ return {name: data.get(name) for name in _fields(cls)}
+
+ @classmethod
+ def from_dict(cls, data: dict[str, Any], /, **overrides: Any) -> Self:
+ if overrides:
+ data.update(overrides)
+ return cls(**cls.filter_dict(data))
+
+
+def error_handling_context(self: _HasManager, item: ScrapeItem | MediaItem | yarl.URL) -> Generator[None]:
+ link: yarl.URL = item if isinstance(item, yarl.URL) else item.url
+ error_log_msg = origin = exc_info = None
+ link_to_show: yarl.URL | str = ""
+ is_segment: bool = getattr(item, "is_segment", False)
+ is_downloader: bool = bool(getattr(self, "log_prefix", False))
try:
- contents = await _request_pypi_info()
+ yield
+ except TooManyCrawlerErrors:
+ return
+ except CDLBaseError as e:
+ error_log_msg = ErrorLogMessage(e.ui_failure, str(e))
+ origin = e.origin
+ link_to_show = getattr(e, "url", None) or link_to_show
+ except NotImplementedError as e:
+ error_log_msg = ErrorLogMessage("NotImplemented")
+ exc_info = e
+ except TooManyRedirects as e:
+ ui_failure = "Too Many Redirects"
+ info = {
+ "url": str(e.request_info.real_url),
+ "history": tuple(str(r.real_url) for r in e.history),
+ }
+ error_log_msg = ErrorLogMessage(ui_failure, f"{ui_failure}\n{info}")
+ except MegaNzError as e:
+ if code := getattr(e, "code", None):
+ if http_code := {
+ -9: HTTPStatus.GONE,
+ -16: HTTPStatus.FORBIDDEN,
+ -24: 509,
+ -401: 509,
+ }.get(code):
+ ui_failure = create_error_msg(http_code)
+ else:
+ ui_failure = f"MegaNZ Error [{code}]"
+ else:
+ ui_failure = "MegaNZ Error"
+
+ error_log_msg = ErrorLogMessage(ui_failure, str(e))
+ except TimeoutError as e:
+ error_log_msg = ErrorLogMessage("Timeout", repr(e))
+ except ClientConnectorError as e:
+ ui_failure = "Client Connector Error"
+ suffix = "" if (link.host or "").startswith(e.host) else f" from {link}"
+ log_msg = f"{e}{suffix}. If you're using a VPN, try turning it off"
+ error_log_msg = ErrorLogMessage(ui_failure, log_msg)
+ except ValidationError as e:
+ exc_info = e
+ ui_failure = create_error_msg(422)
+ log_msg = str(e).partition("For further information")[0].strip()
+ error_log_msg = ErrorLogMessage(ui_failure, log_msg)
except Exception as e:
- logger.error(f"Unable to get latest version information {e!r}")
- raise
- else:
- _parse_pypi_resp(contents)
-
-
-async def _request_pypi_info() -> dict[str, Any]:
- async with aiohttp.request(
- "GET",
- _PYPI_JSON_URL,
- raise_for_status=True,
- timeout=aiohttp.ClientTimeout(sock_read=30, sock_connect=20),
- ) as response:
- return await response.json()
-
-
-def _parse_pypi_resp(data: dict[str, Any]) -> None:
- latest: str = data["info"]["version"]
- releases: set[str] = set(data["releases"])
-
- if current not in releases:
- logger.warning(f"You are using an unreleased version of CDL: {current}. Latest stable release {latest}")
- elif current == latest:
- logger.info(f"You are using the latest version of CDL: {current}")
- else:
- logger.warning(f"A new version is available: {latest}")
+ exc_info = e
+ error_log_msg = ErrorLogMessage.from_unknown_exc(e)
+
+ if error_log_msg is None or is_segment:
+ return
+
+ link_to_show = link_to_show or link
+ origin = origin or get_origin(item)
+ if is_downloader:
+ self, item = cast("Downloader", self), cast("MediaItem", item)
+ self.write_download_error(item, error_log_msg, exc_info)
+ return
+
+ logger.error(f"Scrape Failed: {link_to_show} ({error_log_msg.main_log_msg})", exc_info=exc_info)
+ self.manager.logs.write_scrape_error(link_to_show, error_log_msg.csv_log_msg, origin)
+ self.manager.scrape_mapper.tui.scrape_errors.add(error_log_msg.ui_failure)
+
+
+@overload
+def error_handling_wrapper(
+ func: Callable[Concatenate[_HasManagerT, _Origin, _P], _R],
+) -> Callable[Concatenate[_HasManagerT, _Origin, _P], _R]: ...
+
+
+@overload
+def error_handling_wrapper(
+ func: Callable[Concatenate[_HasManagerT, _Origin, _P], Coroutine[None, None, _R]],
+) -> Callable[Concatenate[_HasManagerT, _Origin, _P], Coroutine[None, None, _R]]: ...
+
+
+def error_handling_wrapper(
+ func: Callable[Concatenate[_HasManagerT, _Origin, _P], _R | Coroutine[None, None, _R]],
+) -> Callable[Concatenate[_HasManagerT, _Origin, _P], _R | Coroutine[None, None, _R]]:
+ """Wrapper handles errors for url scraping."""
+
+ if inspect.iscoroutinefunction(func):
+
+ @functools.wraps(func)
+ async def async_wrapper(self: _HasManagerT, item: _Origin, *args: _P.args, **kwargs: _P.kwargs) -> _R:
+ with error_handling_context(self, item):
+ return await func(self, item, *args, **kwargs)
+
+ return async_wrapper
+
+ @functools.wraps(func)
+ def wrapper(self: _HasManagerT, item: _Origin, *args: _P.args, **kwargs: _P.kwargs) -> _R:
+ with error_handling_context(self, item):
+ result = func(self, item, *args, **kwargs)
+ assert not inspect.isawaitable(result)
+ return result
+
+ return wrapper
+
+
+def get_download_path(manager: Manager, scrape_item: ScrapeItem, domain: str) -> Path:
+ """Returns the path to the download folder."""
+ download_dir = manager.config.settings.files.download_folder
+
+ return download_dir / scrape_item.create_download_path(domain)
+
+
+def _get_size(path: os.DirEntry[str]) -> int | None:
+ try:
+ return path.stat(follow_symlinks=False).st_size
+ except (OSError, ValueError):
+ return
+
+
+def delete_empty_files_and_folders(dirname: Path | str) -> bool:
+ """walks and removes in place"""
+
+ has_non_empty_files = False
+ has_non_empty_subfolders = False
+
+ try:
+ for entry in os.scandir(dirname):
+ try:
+ is_dir = entry.is_dir(follow_symlinks=False)
+ except OSError:
+ is_dir = False
+ if is_dir:
+ deleted = delete_empty_files_and_folders(entry.path)
+ if not deleted:
+ has_non_empty_subfolders = True
+ elif _get_size(entry) == 0:
+ logger.debug(f"Deleting '{entry.path}'")
+ os.unlink(entry) # noqa: PTH108
+ else:
+ has_non_empty_files = True
+
+ except OSError:
+ logger.exception(f"Unknown errot while walking '{dirname}'")
+ pass
+
+ if has_non_empty_files or has_non_empty_subfolders:
+ return False
+ try:
+ os.rmdir(dirname) # noqa: PTH106
+ return True
+ except OSError:
+ return False
+
+
+def check_partials_and_empty_folders(manager: Manager) -> None:
+ download_folder = manager.config.settings.files.download_folder
+
+ _check_for_partial_files(download_folder)
+ settings = manager.config.settings.runtime_options
+ if settings.delete_partial_files:
+ logger.info("Deleting partial downloads...")
+ for file in _partial_files(download_folder):
+ logger.debug(f"Deleting '{file}'")
+ file.unlink(missing_ok=True)
+
+ if settings.skip_check_for_empty_folders:
+ return
+
+ logger.info("Deleting empty files and folders...")
+ _ = delete_empty_files_and_folders(download_folder)
+
+ sorted_folder = manager.config.settings.sorting.sort_folder
+ if sorted_folder and manager.config.settings.sorting.sort_downloads:
+ _ = delete_empty_files_and_folders(sorted_folder)
+
+
+def _partial_files(dir: Path | str) -> Generator[Path]:
+ try:
+ for entry in os.scandir(dir):
+ try:
+ if entry.is_dir(follow_symlinks=False):
+ yield from _partial_files(entry.path)
+ continue
+ except OSError:
+ pass
+
+ suffix = entry.name.rpartition(".")[-1]
+ if f".{suffix}" in TempExt:
+ yield Path(entry.path)
+ except OSError:
+ return
+
+
+def _check_for_partial_files(path: Path) -> None:
+ logger.info("Checking for partial downloads...")
+ has_partial_files = next(_partial_files(path), None)
+ if has_partial_files:
+ logger.warning("There are partial downloads in the downloads folder")
+
+
+def get_text_between(original_text: str, start: str, end: str) -> str:
+ """Extracts the text between two strings in a larger text. Result will be stripped"""
+ start_index = original_text.index(start) + len(start)
+ end_index = original_text.index(end, start_index)
+ return original_text[start_index:end_index].strip()
+
+
+def _str_to_url(link_str: str) -> yarl.URL:
+ if not link_str:
+ raise InvalidURLError("link_str is empty", url=link_str)
+
+ def fix_query_params_encoding(link: str) -> str:
+ if "?" not in link:
+ return link
+ parts, query_and_frag = link.split("?", 1)
+ query_and_frag = query_and_frag.replace("+", "%20")
+ return f"{parts}?{query_and_frag}"
+
+ def fix_multiple_slashes(link_str: str) -> str:
+ return re.sub(r"(?:https?)?:?(\/{3,})", "//", link_str)
+
+ try:
+ clean_link_str = fix_multiple_slashes(fix_query_params_encoding(link_str))
+ return yarl.URL(clean_link_str, encoded="%" in clean_link_str)
+
+ except (AttributeError, ValueError, TypeError) as e:
+ raise InvalidURLError(str(e), url=link_str) from e
+
+
+def parse_url(
+ link_str: AbsoluteHttpURL | yarl.URL | str, relative_to: AbsoluteHttpURL | None = None, *, trim: bool = True
+) -> AbsoluteHttpURL:
+ """Parse a string into an absolute URL, handling relative URLs, encoding and optionally removes trailing slash (trimming).
+ Raises:
+ InvalidURLError: If the input string is not a valid URL or if any other error occurs during parsing.
+ TypeError: If `relative_to` is `None` and the parsed URL is relative or has no scheme.
+ """
+
+ url = _str_to_url(link_str) if isinstance(link_str, str) else link_str
+ if not url.absolute:
+ if not relative_to:
+ raise InvalidURLError("Relative URL with no known base", url=link_str)
+ url = relative_to.join(url)
+ if not url.scheme:
+ url = url.with_scheme(relative_to.scheme if relative_to else "https")
+ assert is_absolute_http_url(url)
+ if not trim:
+ return url
+ return remove_trailing_slash(url)
+
+
+def is_absolute_http_url(url: yarl.URL) -> TypeIs[AbsoluteHttpURL]:
+ return url.absolute and url.scheme.startswith("http")
+
+
+def remove_trailing_slash(url: AbsoluteHttpURL) -> AbsoluteHttpURL:
+ if url.name or url.path == "/":
+ return url
+ return url.parent.with_fragment(url.fragment).with_query(url.query)
+
+
+def remove_parts(
+ url: AbsoluteHttpURL, *parts_to_remove: str, keep_query: bool = True, keep_fragment: bool = True
+) -> AbsoluteHttpURL:
+ if not parts_to_remove:
+ return url
+ new_parts = [p for p in url.parts[1:] if p not in parts_to_remove]
+ return url.with_path("/".join(new_parts), keep_fragment=keep_fragment, keep_query=keep_query)
+
+
+def get_system_information() -> dict[str, Any]:
+ def get_common_name() -> str:
+ system = platform.system()
+
+ if system in ("Linux",):
+ try:
+ return platform.freedesktop_os_release()["PRETTY_NAME"]
+ except OSError:
+ pass
+
+ if system == "Android" and sys.version_info >= (3, 13):
+ ver = platform.android_ver()
+ os_name = f"{system} {ver.release}"
+ for component in (ver.manufacturer, ver.model, ver.device):
+ if component:
+ os_name += f" ({component})"
+ return os_name
+
+ default = platform.platform(aliased=True, terse=True).replace("-", " ")
+ if system == "Windows" and (edition := platform.win32_edition()):
+ return f"{default} {edition}"
+ return default
+
+ system_info = platform.uname()._asdict() | {
+ "architecture": str(platform.architecture()),
+ "python": f"{platform.python_version()} {platform.python_implementation()}",
+ "common_name": get_common_name(),
+ }
+ _ = system_info.pop("node", None)
+ return system_info
+
+
+def is_blob_or_svg(link: str) -> bool:
+ return link.startswith(("data:", "blob:", "javascript:"))
+
+
+def xor_decrypt(encrypted_data: bytes, key: bytes) -> str:
+ data = bytearray(b_input ^ b_key for b_input, b_key in zip(encrypted_data, itertools.cycle(key)))
+ return data.decode("utf-8", errors="ignore")
diff --git a/cyberdrop_dl/utils/m3u8.py b/cyberdrop_dl/utils/m3u8.py
index 181b546eb..3f074442b 100644
--- a/cyberdrop_dl/utils/m3u8.py
+++ b/cyberdrop_dl/utils/m3u8.py
@@ -10,13 +10,13 @@ import m3u8.model
from m3u8 import M3U8 as _M3U8
from m3u8 import Media, Playlist
-from cyberdrop_dl.data_structures.mediaprops import Codecs, Resolution
-from cyberdrop_dl.utils.utilities import parse_url
+from cyberdrop_dl.mediaprops import Codecs, Resolution
+from cyberdrop_dl.utils import parse_url
if TYPE_CHECKING:
from collections.abc import Generator, Iterable
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+ from cyberdrop_dl.url_objects import AbsoluteHttpURL
class MediaType(StrEnum):
diff --git a/cyberdrop_dl/utils/utilities.py b/cyberdrop_dl/utils/utilities.py
deleted file mode 100644
index 100670151..000000000
--- a/cyberdrop_dl/utils/utilities.py
+++ /dev/null
@@ -1,391 +0,0 @@
-from __future__ import annotations
-
-import contextlib
-import dataclasses
-import functools
-import inspect
-import itertools
-import logging
-import os
-import platform
-import re
-import sys
-from http import HTTPStatus
-from pathlib import Path
-from typing import TYPE_CHECKING, Any, ClassVar, Concatenate, ParamSpec, Protocol, Self, TypeVar, cast, overload
-
-import yarl
-from aiohttp import ClientConnectorError, TooManyRedirects
-from mega.errors import MegaNzError
-from pydantic import ValidationError
-from typing_extensions import TypeIs
-
-from cyberdrop_dl.constants import TempExt
-from cyberdrop_dl.exceptions import (
- CDLBaseError,
- ErrorLogMessage,
- InvalidURLError,
- TooManyCrawlerErrors,
- create_error_msg,
- get_origin,
-)
-
-if TYPE_CHECKING:
- from collections.abc import Callable, Coroutine, Generator
-
- from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, MediaItem, ScrapeItem
- from cyberdrop_dl.downloader.downloader import Downloader
- from cyberdrop_dl.managers.manager import Manager
-
- class _HasManager(Protocol):
- manager: Manager
-
- _HasManagerT = TypeVar("_HasManagerT", bound=_HasManager)
- _Origin = TypeVar("_Origin", bound=ScrapeItem | MediaItem | yarl.URL)
-
-_P = ParamSpec("_P")
-_R = TypeVar("_R")
-
-
-class Dataclass(Protocol):
- __dataclass_fields__: ClassVar[dict[str, Any]]
-
-
-logger = logging.getLogger(__name__)
-
-
-_FIELDS_CACHE: dict[type, tuple[str, ...]] = {}
-
-
-def _fields(cls: type) -> tuple[str, ...]:
- if fields := _FIELDS_CACHE.get(cls):
- return fields
- fields = _FIELDS_CACHE[cls] = tuple(f.name for f in dataclasses.fields(cls))
- return fields
-
-
-class DictDataclass(Dataclass, Protocol):
- @classmethod
- def filter_dict(cls, data: dict[str, Any], /) -> dict[str, Any]:
- return {name: data.get(name) for name in _fields(cls)}
-
- @classmethod
- def from_dict(cls, data: dict[str, Any], /, **overrides: Any) -> Self:
- if overrides:
- data.update(overrides)
- return cls(**cls.filter_dict(data))
-
-
-def error_handling_context(self: _HasManager, item: ScrapeItem | MediaItem | yarl.URL) -> Generator[None]:
- link: yarl.URL = item if isinstance(item, yarl.URL) else item.url
- error_log_msg = origin = exc_info = None
- link_to_show: yarl.URL | str = ""
- is_segment: bool = getattr(item, "is_segment", False)
- is_downloader: bool = bool(getattr(self, "log_prefix", False))
- try:
- yield
- except TooManyCrawlerErrors:
- return
- except CDLBaseError as e:
- error_log_msg = ErrorLogMessage(e.ui_failure, str(e))
- origin = e.origin
- link_to_show = getattr(e, "url", None) or link_to_show
- except NotImplementedError as e:
- error_log_msg = ErrorLogMessage("NotImplemented")
- exc_info = e
- except TooManyRedirects as e:
- ui_failure = "Too Many Redirects"
- info = {
- "url": str(e.request_info.real_url),
- "history": tuple(str(r.real_url) for r in e.history),
- }
- error_log_msg = ErrorLogMessage(ui_failure, f"{ui_failure}\n{info}")
- except MegaNzError as e:
- if code := getattr(e, "code", None):
- if http_code := {
- -9: HTTPStatus.GONE,
- -16: HTTPStatus.FORBIDDEN,
- -24: 509,
- -401: 509,
- }.get(code):
- ui_failure = create_error_msg(http_code)
- else:
- ui_failure = f"MegaNZ Error [{code}]"
- else:
- ui_failure = "MegaNZ Error"
-
- error_log_msg = ErrorLogMessage(ui_failure, str(e))
-
- except TimeoutError as e:
- error_log_msg = ErrorLogMessage("Timeout", repr(e))
- except ClientConnectorError as e:
- ui_failure = "Client Connector Error"
- suffix = "" if (link.host or "").startswith(e.host) else f" from {link}"
- log_msg = f"{e}{suffix}. If you're using a VPN, try turning it off"
- error_log_msg = ErrorLogMessage(ui_failure, log_msg)
- except ValidationError as e:
- exc_info = e
- ui_failure = create_error_msg(422)
- log_msg = str(e).partition("For further information")[0].strip()
- error_log_msg = ErrorLogMessage(ui_failure, log_msg)
- except Exception as e:
- exc_info = e
- error_log_msg = ErrorLogMessage.from_unknown_exc(e)
-
- if error_log_msg is None or is_segment:
- return
-
- link_to_show = link_to_show or link
- origin = origin or get_origin(item)
- if is_downloader:
- self, item = cast("Downloader", self), cast("MediaItem", item)
- self.write_download_error(item, error_log_msg, exc_info)
- return
-
- logger.error(f"Scrape Failed: {link_to_show} ({error_log_msg.main_log_msg})", exc_info=exc_info)
- self.manager.logs.write_scrape_error(link_to_show, error_log_msg.csv_log_msg, origin)
- self.manager.scrape_mapper.tui.scrape_errors.add(error_log_msg.ui_failure)
-
-
-@overload
-def error_handling_wrapper(
- func: Callable[Concatenate[_HasManagerT, _Origin, _P], _R],
-) -> Callable[Concatenate[_HasManagerT, _Origin, _P], _R]: ...
-
-
-@overload
-def error_handling_wrapper(
- func: Callable[Concatenate[_HasManagerT, _Origin, _P], Coroutine[None, None, _R]],
-) -> Callable[Concatenate[_HasManagerT, _Origin, _P], Coroutine[None, None, _R]]: ...
-
-
-def error_handling_wrapper(
- func: Callable[Concatenate[_HasManagerT, _Origin, _P], _R | Coroutine[None, None, _R]],
-) -> Callable[Concatenate[_HasManagerT, _Origin, _P], _R | Coroutine[None, None, _R]]:
- """Wrapper handles errors for url scraping."""
-
- if inspect.iscoroutinefunction(func):
-
- @functools.wraps(func)
- async def async_wrapper(self: _HasManagerT, item: _Origin, *args: _P.args, **kwargs: _P.kwargs) -> _R:
- with error_handling_context(self, item):
- return await func(self, item, *args, **kwargs)
-
- return async_wrapper
-
- @functools.wraps(func)
- def wrapper(self: _HasManagerT, item: _Origin, *args: _P.args, **kwargs: _P.kwargs) -> _R:
- with error_handling_context(self, item):
- result = func(self, item, *args, **kwargs)
- assert not inspect.isawaitable(result)
- return result
-
- return wrapper
-
-
-def get_download_path(manager: Manager, scrape_item: ScrapeItem, domain: str) -> Path:
- """Returns the path to the download folder."""
- download_dir = manager.config.settings.files.download_folder
-
- return download_dir / scrape_item.create_download_path(domain)
-
-
-def _get_size(path: os.DirEntry[str]) -> int | None:
- try:
- return path.stat(follow_symlinks=False).st_size
- except (OSError, ValueError):
- return
-
-
-def delete_empty_files_and_folders(dirname: Path | str) -> bool:
- """walks and removes in place"""
-
- has_non_empty_files = False
- has_non_empty_subfolders = False
-
- try:
- for entry in os.scandir(dirname):
- try:
- is_dir = entry.is_dir(follow_symlinks=False)
- except OSError:
- is_dir = False
- if is_dir:
- deleted = delete_empty_files_and_folders(entry.path)
- if not deleted:
- has_non_empty_subfolders = True
- elif _get_size(entry) == 0:
- logger.debug(f"Deleting '{entry.path}'")
- os.unlink(entry) # noqa: PTH108
- else:
- has_non_empty_files = True
-
- except OSError:
- logger.exception(f"Unknown errot while walking '{dirname}'")
- pass
-
- if has_non_empty_files or has_non_empty_subfolders:
- return False
- try:
- os.rmdir(dirname) # noqa: PTH106
- return True
- except OSError:
- return False
-
-
-def check_partials_and_empty_folders(manager: Manager) -> None:
- download_folder = manager.config.settings.files.download_folder
-
- _check_for_partial_files(download_folder)
- settings = manager.config.settings.runtime_options
- if settings.delete_partial_files:
- logger.info("Deleting partial downloads...")
- for file in _partial_files(download_folder):
- logger.debug(f"Deleting '{file}'")
- file.unlink(missing_ok=True)
-
- if settings.skip_check_for_empty_folders:
- return
-
- logger.info("Deleting empty files and folders...")
- _ = delete_empty_files_and_folders(download_folder)
-
- sorted_folder = manager.config.settings.sorting.sort_folder
- if sorted_folder and manager.config.settings.sorting.sort_downloads:
- _ = delete_empty_files_and_folders(sorted_folder)
-
-
-def _partial_files(dir: Path | str) -> Generator[Path]:
- try:
- for entry in os.scandir(dir):
- try:
- if entry.is_dir(follow_symlinks=False):
- yield from _partial_files(entry.path)
- continue
- except OSError:
- pass
-
- suffix = entry.name.rpartition(".")[-1]
- if f".{suffix}" in TempExt:
- yield Path(entry.path)
- except OSError:
- return
-
-
-def _check_for_partial_files(path: Path) -> None:
- logger.info("Checking for partial downloads...")
- has_partial_files = next(_partial_files(path), None)
- if has_partial_files:
- logger.warning("There are partial downloads in the downloads folder")
-
-
-def get_text_between(original_text: str, start: str, end: str) -> str:
- """Extracts the text between two strings in a larger text. Result will be stripped"""
- start_index = original_text.index(start) + len(start)
- end_index = original_text.index(end, start_index)
- return original_text[start_index:end_index].strip()
-
-
-def _str_to_url(link_str: str) -> yarl.URL:
- if not link_str:
- raise InvalidURLError("link_str is empty", url=link_str)
-
- def fix_query_params_encoding(link: str) -> str:
- if "?" not in link:
- return link
- parts, query_and_frag = link.split("?", 1)
- query_and_frag = query_and_frag.replace("+", "%20")
- return f"{parts}?{query_and_frag}"
-
- def fix_multiple_slashes(link_str: str) -> str:
- return re.sub(r"(?:https?)?:?(\/{3,})", "//", link_str)
-
- try:
- clean_link_str = fix_multiple_slashes(fix_query_params_encoding(link_str))
- return yarl.URL(clean_link_str, encoded="%" in clean_link_str)
-
- except (AttributeError, ValueError, TypeError) as e:
- raise InvalidURLError(str(e), url=link_str) from e
-
-
-def parse_url(
- link_str: AbsoluteHttpURL | yarl.URL | str, relative_to: AbsoluteHttpURL | None = None, *, trim: bool = True
-) -> AbsoluteHttpURL:
- """Parse a string into an absolute URL, handling relative URLs, encoding and optionally removes trailing slash (trimming).
- Raises:
- InvalidURLError: If the input string is not a valid URL or if any other error occurs during parsing.
- TypeError: If `relative_to` is `None` and the parsed URL is relative or has no scheme.
- """
-
- url = _str_to_url(link_str) if isinstance(link_str, str) else link_str
- if not url.absolute:
- if not relative_to:
- raise InvalidURLError("Relative URL with no known base", url=link_str)
- url = relative_to.join(url)
- if not url.scheme:
- url = url.with_scheme(relative_to.scheme if relative_to else "https")
- assert is_absolute_http_url(url)
- if not trim:
- return url
- return remove_trailing_slash(url)
-
-
-def is_absolute_http_url(url: yarl.URL) -> TypeIs[AbsoluteHttpURL]:
- return url.absolute and url.scheme.startswith("http")
-
-
-def remove_trailing_slash(url: AbsoluteHttpURL) -> AbsoluteHttpURL:
- if url.name or url.path == "/":
- return url
- return url.parent.with_fragment(url.fragment).with_query(url.query)
-
-
-def remove_parts(
- url: AbsoluteHttpURL, *parts_to_remove: str, keep_query: bool = True, keep_fragment: bool = True
-) -> AbsoluteHttpURL:
- if not parts_to_remove:
- return url
- new_parts = [p for p in url.parts[1:] if p not in parts_to_remove]
- return url.with_path("/".join(new_parts), keep_fragment=keep_fragment, keep_query=keep_query)
-
-
-def get_system_information() -> dict[str, Any]:
- def get_common_name() -> str:
- system = platform.system()
-
- if system in ("Linux",):
- try:
- return platform.freedesktop_os_release()["PRETTY_NAME"]
- except OSError:
- pass
-
- if system == "Android" and sys.version_info >= (3, 13):
- ver = platform.android_ver()
- os_name = f"{system} {ver.release}"
- for component in (ver.manufacturer, ver.model, ver.device):
- if component:
- os_name += f" ({component})"
- return os_name
-
- default = platform.platform(aliased=True, terse=True).replace("-", " ")
- if system == "Windows" and (edition := platform.win32_edition()):
- return f"{default} {edition}"
- return default
-
- system_info = platform.uname()._asdict() | {
- "architecture": str(platform.architecture()),
- "python": f"{platform.python_version()} {platform.python_implementation()}",
- "common_name": get_common_name(),
- }
- _ = system_info.pop("node", None)
- return system_info
-
-
-def is_blob_or_svg(link: str) -> bool:
- return link.startswith(("data:", "blob:", "javascript:"))
-
-
-def xor_decrypt(encrypted_data: bytes, key: bytes) -> str:
- data = bytearray(b_input ^ b_key for b_input, b_key in zip(encrypted_data, itertools.cycle(key)))
- return data.decode("utf-8", errors="ignore")
diff --git a/pyproject.toml b/pyproject.toml
index 1a825d93a..44e4fb507 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -44,7 +44,7 @@ license = "GPL-3.0-only"
license-files = ["LICENSE"]
readme = "README.md"
requires-python = ">=3.11"
-version = "9.2.0"
+version = "9.2.1.dev0"
[project.optional-dependencies]
extras = [
diff --git a/tests/crawlers/test_crawlers.py b/tests/crawlers/test_crawlers.py
index 2ee11527f..8f0b16227 100644
--- a/tests/crawlers/test_crawlers.py
+++ b/tests/crawlers/test_crawlers.py
@@ -12,10 +12,9 @@ import pytest
from pydantic import TypeAdapter
from typing_extensions import TypedDict
-from cyberdrop_dl.data_structures import AbsoluteHttpURL
-from cyberdrop_dl.data_structures.url_objects import MediaItem, ScrapeItem
from cyberdrop_dl.scrape_mapper import ScrapeMapper
-from cyberdrop_dl.utils.utilities import parse_url
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, MediaItem, ScrapeItem
+from cyberdrop_dl.utils import parse_url
if TYPE_CHECKING:
from cyberdrop_dl.crawlers.crawler import Crawler
diff --git a/tests/crawlers/test_vbulletin.py b/tests/crawlers/test_vbulletin.py
index 78f4e8915..5b8562fb9 100644
--- a/tests/crawlers/test_vbulletin.py
+++ b/tests/crawlers/test_vbulletin.py
@@ -3,7 +3,7 @@ from __future__ import annotations
import pytest
from cyberdrop_dl.crawlers import _forum, vbulletin
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
@pytest.mark.parametrize(
diff --git a/tests/crawlers/test_xenforo.py b/tests/crawlers/test_xenforo.py
index 10736db48..a2044cf40 100644
--- a/tests/crawlers/test_xenforo.py
+++ b/tests/crawlers/test_xenforo.py
@@ -9,9 +9,9 @@ from bs4 import BeautifulSoup
from cyberdrop_dl.crawlers import _forum
from cyberdrop_dl.crawlers import xenforo as crawlers
from cyberdrop_dl.crawlers.xenforo import xenforo
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.exceptions import ScrapeError
from cyberdrop_dl.managers.manager import Manager
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
def _item(url: str) -> ScrapeItem:
diff --git a/tests/test_database.py b/tests/test_database.py
index 17266769d..e5341693f 100644
--- a/tests/test_database.py
+++ b/tests/test_database.py
@@ -7,9 +7,9 @@ from typing import TYPE_CHECKING, cast
import pytest
from cyberdrop_dl import scrape_mapper
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL, ScrapeItem
from cyberdrop_dl.scrape_mapper import _create_item_from_row
-from cyberdrop_dl.utils.utilities import parse_url
+from cyberdrop_dl.url_objects import AbsoluteHttpURL, ScrapeItem
+from cyberdrop_dl.utils import parse_url
if TYPE_CHECKING:
import aiosqlite
diff --git a/tests/test_download_client.py b/tests/test_download_client.py
index c4dc83de5..64bec393b 100644
--- a/tests/test_download_client.py
+++ b/tests/test_download_client.py
@@ -3,7 +3,7 @@ from typing import cast
import pytest
from cyberdrop_dl.clients import download_client
-from cyberdrop_dl.data_structures import MediaItem
+from cyberdrop_dl.url_objects import MediaItem
def _item(fallbacks_: object) -> MediaItem:
diff --git a/tests/test_ffmpeg.py b/tests/test_ffmpeg.py
index 0e64b6982..7d28f3385 100644
--- a/tests/test_ffmpeg.py
+++ b/tests/test_ffmpeg.py
@@ -3,7 +3,7 @@ import datetime
import pytest
from cyberdrop_dl import ffmpeg
-from cyberdrop_dl.data_structures import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
FFPROBE_IS_INSTALLED = bool(ffmpeg.get_ffprobe_version())
diff --git a/tests/test_flaresolverr.py b/tests/test_flaresolverr.py
index 779b19235..f698e6097 100644
--- a/tests/test_flaresolverr.py
+++ b/tests/test_flaresolverr.py
@@ -5,7 +5,7 @@ import aiohttp
import pytest
from cyberdrop_dl.clients.flaresolverr import Command, FlareSolverrClient
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
ENV_NAME = "CDL_FLARESOLVERR"
FLARESOLVER_URL = os.environ.get(ENV_NAME, "") # or "http://localhost:8191"
diff --git a/tests/test_m3u8.py b/tests/test_m3u8.py
index a903c4ff5..4a028954b 100644
--- a/tests/test_m3u8.py
+++ b/tests/test_m3u8.py
@@ -3,8 +3,8 @@ from typing import LiteralString
import pytest
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
from cyberdrop_dl.exceptions import InvalidURLError
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
from cyberdrop_dl.utils import m3u8
diff --git a/tests/test_real_debrid.py b/tests/test_real_debrid.py
index 076622895..dc2feff66 100644
--- a/tests/test_real_debrid.py
+++ b/tests/test_real_debrid.py
@@ -1,7 +1,7 @@
import pytest
from cyberdrop_dl.crawlers import realdebrid
-from cyberdrop_dl.data_structures.url_objects import AbsoluteHttpURL
+from cyberdrop_dl.url_objects import AbsoluteHttpURL
@pytest.mark.parametrize(
diff --git a/tests/test_sorter.py b/tests/test_sorter.py
index 64e9e92c0..5a09ddc64 100644
--- a/tests/test_sorter.py
+++ b/tests/test_sorter.py
@@ -5,7 +5,7 @@ from pathlib import Path
import pytest
-from cyberdrop_dl.utils.sorting import Sorter, _format_dest, _have_same_content, _move_file
+from cyberdrop_dl.sorter import Sorter, _format_dest, _have_same_content, _move_file
DOWNLOADS = Path("/mnt/home/user/downloads/cdl/")
SORT_DIR = DOWNLOADS.parent / "cdl_sorted"
diff --git a/uv.lock b/uv.lock
index c17ba3f7f..bd93a360d 100644
--- a/uv.lock
+++ b/uv.lock
@@ -743,7 +743,7 @@ wheels = [
[[package]]
name = "cyberdrop-dl-patched"
-version = "9.1.1"
+version = "9.2.1.dev0"
source = { editable = "." }
dependencies = [
{ name = "aiodns", marker = "sys_platform != 'android'" },