|
|
@@ -20,16 +20,16 @@ from ..logging_util import TimedProgress
|
|
|
|
|
|
|
|
|
@enforce_types
|
|
|
-def should_save_dom(link: Link, out_dir: Optional[Path]=None) -> bool:
|
|
|
- out_dir = out_dir or Path(link.link_dir)
|
|
|
+def should_save_dom(link: Link, out_dir: Optional[Path]=None, overwrite: Optional[bool]=False) -> bool:
|
|
|
if is_static_file(link.url):
|
|
|
return False
|
|
|
-
|
|
|
- if (out_dir / 'output.html').exists():
|
|
|
+
|
|
|
+ out_dir = out_dir or Path(link.link_dir)
|
|
|
+ if not overwrite and (out_dir / 'output.html').exists():
|
|
|
return False
|
|
|
|
|
|
return SAVE_DOM
|
|
|
-
|
|
|
+
|
|
|
@enforce_types
|
|
|
def save_dom(link: Link, out_dir: Optional[Path]=None, timeout: int=TIMEOUT) -> ArchiveResult:
|
|
|
"""print HTML of site to file using chrome --dump-html"""
|