From ea02ae9e8eef76a52a45e1eb8a03967007a93fd3 Mon Sep 17 00:00:00 2001 From: Adrien Barbaresi Date: Mon, 21 Oct 2024 13:58:47 +0200 Subject: [PATCH] UrlStore: update parameters in get_download_urls() (#119) --- courlan/urlstore.py | 6 +----- tests/urlstore_tests.py | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/courlan/urlstore.py b/courlan/urlstore.py index b96d845..0bcafcc 100644 --- a/courlan/urlstore.py +++ b/courlan/urlstore.py @@ -415,15 +415,11 @@ def get_url(self, domain: str, as_visited: bool = True) -> Optional[str]: def get_download_urls( self, - time_limit: int = 10, + time_limit: float = 10.0, max_urls: int = 10000, - timelimit: Optional[int] = None, # TODO: remove later ) -> Optional[List[str]]: """Get a list of immediately downloadable URLs according to the given time limit per domain.""" - if timelimit is not None: - raise ValueError("timelimit is deprecated, use time_limit instead") - urls = [] for website, entry in self.urldict.items(): if entry.state != State.OPEN: diff --git a/tests/urlstore_tests.py b/tests/urlstore_tests.py index ab171b1..49bb715 100644 --- a/tests/urlstore_tests.py +++ b/tests/urlstore_tests.py @@ -315,9 +315,6 @@ def test_urlstore(): ["https://www.example.org/1", "https://test.org/1", "https://test.org/2"] ) - with pytest.raises(ValueError): - test_urls.get_download_urls(timelimit=0) - downloadable_urls = test_urls.get_download_urls(time_limit=0) assert ( len(downloadable_urls) == 2