mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 14:44:18 +00:00
feat: Avoid running readability when the target is a file
This commit is contained in:
parent
61e08a7c43
commit
a14762640e
1 changed files with 3 additions and 0 deletions
|
@ -11,6 +11,7 @@ from ..system import run, atomic_write
|
|||
from ..util import (
|
||||
enforce_types,
|
||||
download_url,
|
||||
is_static_file,
|
||||
|
||||
)
|
||||
from ..config import (
|
||||
|
@ -26,6 +27,8 @@ from ..logging_util import TimedProgress
|
|||
@enforce_types
|
||||
def should_save_readability(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) / 'readability.json'
|
||||
return SAVE_READABILITY and (not output.exists())
|
||||
|
|
Loading…
Reference in a new issue