diff --git a/PyFunceble/__init__.py b/PyFunceble/__init__.py index 3e85934d..f6786834 100644 --- a/PyFunceble/__init__.py +++ b/PyFunceble/__init__.py @@ -53,7 +53,6 @@ from typing import List import PyFunceble.storage -import PyFunceble.facility from PyFunceble.checker.availability.domain import DomainAvailabilityChecker from PyFunceble.checker.availability.domain_and_ip import DomainAndIPAvailabilityChecker from PyFunceble.checker.availability.ip import IPAvailabilityChecker diff --git a/PyFunceble/downloader/base.py b/PyFunceble/downloader/base.py index 97c473c1..851ee944 100644 --- a/PyFunceble/downloader/base.py +++ b/PyFunceble/downloader/base.py @@ -53,6 +53,7 @@ import datetime import os from typing import Optional +import importlib import PyFunceble.downloader.exceptions import PyFunceble.exceptions @@ -72,6 +73,7 @@ class DownloaderBase: the download mechanism but also the generation or update of that JSON file. """ + DOWNTIME_INDEX: Optional[str] = None """ Used to set/track the download time of the current file. @@ -275,6 +277,7 @@ def start(self) -> None: Starts the download process. """ + if self.authorized and self.is_last_download_expired(): if not hasattr(self, "destination") or not self.destination: raise PyFunceble.downloader.exceptions.NoDownloadDestinationGiven() @@ -282,6 +285,8 @@ def start(self) -> None: if not hasattr(self, "download_link") or not self.download_link: raise PyFunceble.downloader.exceptions.NoDownloadLinkGiven() + importlib.import_module("PyFunceble.factory") + if DownloadHelper( self.download_link, session=PyFunceble.factory.Requester ).download_text(destination=self.destination):