Skip to content

Commit

Permalink
Fix crawl_command interaction of url_cache & unique kwargs
Browse files Browse the repository at this point in the history
Fix #924
  • Loading branch information
Yomguithereal committed Dec 20, 2023
1 parent 8dd148d commit 34b407e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions minet/cli/crawl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@
},
]

def delete(o, k):
try:
del o[k]
except KeyError:
pass


def crawl_command(
name: str,
Expand Down Expand Up @@ -198,11 +204,11 @@ def set_default_value(k, v):

# NOTE: missing a lot in the resolve here
if unique:
del arguments_dict["visit_urls_only_once"]
delete(arguments_dict, "visit_urls_only_once")

if not url_cache:
del arguments_dict["visit_urls_only_once"]
del arguments_dict["normalized_url_cache"]
delete(arguments_dict, "visit_urls_only_once")
delete(arguments_dict, "normalized_url_cache")

if not max_depth:
del arguments_dict["max_depth"]
Expand Down

0 comments on commit 34b407e

Please sign in to comment.