mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-16 16:14:28 -04: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 (
|
from ..util import (
|
||||||
enforce_types,
|
enforce_types,
|
||||||
download_url,
|
download_url,
|
||||||
|
is_static_file,
|
||||||
|
|
||||||
)
|
)
|
||||||
from ..config import (
|
from ..config import (
|
||||||
|
@ -26,6 +27,8 @@ from ..logging_util import TimedProgress
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def should_save_readability(link: Link, out_dir: Optional[str]=None) -> bool:
|
def should_save_readability(link: Link, out_dir: Optional[str]=None) -> bool:
|
||||||
out_dir = out_dir or link.link_dir
|
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'
|
output = Path(out_dir or link.link_dir) / 'readability.json'
|
||||||
return SAVE_READABILITY and (not output.exists())
|
return SAVE_READABILITY and (not output.exists())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue