refactor: Change add() to receive url and depth instead of import_str and import_path

This commit is contained in:
Cristian 2020-07-08 08:17:47 -05:00
parent c1d8a74e4f
commit f12bfeb322
3 changed files with 15 additions and 30 deletions

View file

@ -66,12 +66,10 @@ class AddLinks(View):
if form.is_valid():
url = form.cleaned_data["url"]
print(f'[+] Adding URL: {url}')
if form.cleaned_data["source"] == "url":
key = "import_str"
else:
key = "import_path"
depth = 0 if form.cleaned_data["source"] == "url" else 1
input_kwargs = {
key: url,
"url": url,
"depth": depth,
"update_all": False,
"out_dir": OUTPUT_DIR,
}