mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
feat: Add --extract flag to update command
This commit is contained in:
parent
f467435797
commit
35389608d1
2 changed files with 18 additions and 1 deletions
|
@ -680,6 +680,7 @@ def update(resume: Optional[float]=None,
|
|||
status: Optional[str]=None,
|
||||
after: Optional[str]=None,
|
||||
before: Optional[str]=None,
|
||||
extractors: str="",
|
||||
out_dir: Path=OUTPUT_DIR) -> List[Link]:
|
||||
"""Import any new links from subscriptions and retry any previously failed/skipped links"""
|
||||
|
||||
|
@ -687,6 +688,8 @@ def update(resume: Optional[float]=None,
|
|||
check_dependencies()
|
||||
new_links: List[Link] = [] # TODO: Remove input argument: only_new
|
||||
|
||||
extractors = extractors.split(",") if extractors else []
|
||||
|
||||
# Step 1: Filter for selected_links
|
||||
matching_snapshots = list_links(
|
||||
filter_patterns=filter_patterns,
|
||||
|
@ -717,7 +720,13 @@ def update(resume: Optional[float]=None,
|
|||
stderr(f'[√] Nothing found to resume after {resume}', color='green')
|
||||
return all_links
|
||||
|
||||
archive_links(to_archive, overwrite=overwrite, out_dir=out_dir)
|
||||
archive_kwargs = {
|
||||
"out_dir": out_dir,
|
||||
}
|
||||
if extractors:
|
||||
archive_kwargs["methods"] = extractors
|
||||
|
||||
archive_links(to_archive, overwrite=overwrite, **archive_kwargs)
|
||||
|
||||
# Step 4: Re-write links index with updated titles, icons, and resources
|
||||
all_links = load_main_index(out_dir=out_dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue