1
0
Fork 0

add missing staticfile check to singlefile

This commit is contained in:
Nick Sweeting 2020-08-10 13:42:20 -04:00
parent dfa5d55c36
commit 430be7bc68

View file

@ -9,7 +9,8 @@ from ..index.schema import Link, ArchiveResult, ArchiveError
from ..system import run, chmod_file
from ..util import (
enforce_types,
chrome_args
is_static_file,
chrome_args,
)
from ..config import (
TIMEOUT,
@ -24,6 +25,8 @@ from ..logging_util import TimedProgress
@enforce_types
def should_save_singlefile(link: Link, out_dir: Optional[str]=None) -> bool:
out_dir = out_dir or link.link_dir
if is_static_file(link.url):
return False
output = Path(out_dir or link.link_dir) / 'singlefile.html'
return SAVE_SINGLEFILE and (not output.exists())