mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-27 08:14:38 +02:00
show progress during validate_links
This commit is contained in:
@@ -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]:
|
||||||
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
|
timer = TimedProgress(TIMEOUT * 4)
|
||||||
links = sorted_links(links) # deterministically sort the links based on timstamp, url
|
try:
|
||||||
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
|
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
|
||||||
|
links = sorted_links(links) # deterministically sort the links based on timstamp, url
|
||||||
if not links:
|
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
|
||||||
stderr('{red}[X] No links found in index.{reset}'.format(**ANSI))
|
finally:
|
||||||
stderr(' To add a link to your archive, run:')
|
timer.end()
|
||||||
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)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user