mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00:00
fix: Add condition for oneshot when archiving links
This commit is contained in:
parent
4484491fb7
commit
f292cface2
1 changed files with 5 additions and 3 deletions
|
@ -66,8 +66,9 @@ def archive_link(link: Link, overwrite: bool=False, methods: Optional[Iterable[s
|
|||
"""download the DOM, PDF, and a screenshot into a folder named after the link's timestamp"""
|
||||
|
||||
# TODO: Remove when the input is changed to be a snapshot. Suboptimal approach.
|
||||
from core.models import Snapshot, ArchiveResult
|
||||
snapshot = Snapshot.objects.get(url=link.url)
|
||||
if not skip_index:
|
||||
from core.models import Snapshot, ArchiveResult
|
||||
snapshot = Snapshot.objects.get(url=link.url)
|
||||
|
||||
ARCHIVE_METHODS = get_default_archive_methods()
|
||||
|
||||
|
@ -103,7 +104,8 @@ def archive_link(link: Link, overwrite: bool=False, methods: Optional[Iterable[s
|
|||
|
||||
stats[result.status] += 1
|
||||
log_archive_method_finished(result)
|
||||
ArchiveResult.objects.create(snapshot=snapshot, extractor=method_name, cmd=result.cmd, cmd_version=result.cmd_version,
|
||||
if not skip_index:
|
||||
ArchiveResult.objects.create(snapshot=snapshot, extractor=method_name, cmd=result.cmd, cmd_version=result.cmd_version,
|
||||
output=result.output, pwd=result.pwd, start_ts=result.start_ts, end_ts=result.end_ts, status=result.status)
|
||||
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue