mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-17 00:24:26 -04:00
show progress during validate_links
This commit is contained in:
parent
f60b5ed867
commit
1ac99621ab
1 changed files with 7 additions and 12 deletions
|
@ -122,18 +122,13 @@ def merge_links(a: Link, b: Link) -> Link:
|
||||||
|
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def validate_links(links: Iterable[Link]) -> List[Link]:
|
def validate_links(links: Iterable[Link]) -> List[Link]:
|
||||||
|
timer = TimedProgress(TIMEOUT * 4)
|
||||||
|
try:
|
||||||
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
|
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
|
||||||
links = sorted_links(links) # deterministically sort the links based on timstamp, url
|
links = sorted_links(links) # deterministically sort the links based on timstamp, url
|
||||||
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
|
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
|
||||||
|
finally:
|
||||||
if not links:
|
timer.end()
|
||||||
stderr('{red}[X] No links found in index.{reset}'.format(**ANSI))
|
|
||||||
stderr(' To add a link to your archive, run:')
|
|
||||||
stderr(" archivebox add 'https://example.com'")
|
|
||||||
stderr()
|
|
||||||
stderr(' For more usage and examples, run:')
|
|
||||||
stderr(' archivebox help')
|
|
||||||
raise SystemExit(1)
|
|
||||||
|
|
||||||
return list(links)
|
return list(links)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue