mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
feat: Initial oneshot command proposal
This commit is contained in:
parent
685f85aaae
commit
c073ea141d
6 changed files with 148 additions and 33 deletions
|
@ -18,6 +18,7 @@ from .cli import (
|
|||
from .parsers import (
|
||||
save_text_as_source,
|
||||
save_file_as_source,
|
||||
parse_links_memory,
|
||||
)
|
||||
from .index.schema import Link
|
||||
from .util import enforce_types # type: ignore
|
||||
|
@ -493,6 +494,13 @@ def status(out_dir: str=OUTPUT_DIR) -> None:
|
|||
print(ANSI['black'], ' ...', ANSI['reset'])
|
||||
|
||||
|
||||
@enforce_types
|
||||
def oneshot(url: str, out_dir: str=OUTPUT_DIR):
|
||||
oneshot_links, _ = parse_links_memory([url])
|
||||
oneshot_links, _ = dedupe_links([], oneshot_links)
|
||||
archive_links(oneshot_links, out_dir=out_dir, skip_index=True)
|
||||
return oneshot_links
|
||||
|
||||
@enforce_types
|
||||
def add(urls: Union[str, List[str]],
|
||||
depth: int=0,
|
||||
|
@ -1055,3 +1063,4 @@ def shell(out_dir: str=OUTPUT_DIR) -> None:
|
|||
setup_django(OUTPUT_DIR)
|
||||
from django.core.management import call_command
|
||||
call_command("shell_plus")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue