mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-22 20:23:12 +00: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
|
||||
def validate_links(links: Iterable[Link]) -> List[Link]:
|
||||
timer = TimedProgress(TIMEOUT * 4)
|
||||
try:
|
||||
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
|
||||
links = sorted_links(links) # deterministically sort the links based on timstamp, url
|
||||
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
|
||||
|
||||
if not links:
|
||||
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)
|
||||
finally:
|
||||
timer.end()
|
||||
|
||||
return list(links)
|
||||
|
||||
|
|
Loading…
Reference in a new issue