mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-09 16:17:10 +02:00
fix: Add condition for oneshot when archiving links
This commit is contained in:
@@ -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"""
|
"""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.
|
# TODO: Remove when the input is changed to be a snapshot. Suboptimal approach.
|
||||||
from core.models import Snapshot, ArchiveResult
|
if not skip_index:
|
||||||
snapshot = Snapshot.objects.get(url=link.url)
|
from core.models import Snapshot, ArchiveResult
|
||||||
|
snapshot = Snapshot.objects.get(url=link.url)
|
||||||
|
|
||||||
ARCHIVE_METHODS = get_default_archive_methods()
|
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
|
stats[result.status] += 1
|
||||||
log_archive_method_finished(result)
|
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)
|
output=result.output, pwd=result.pwd, start_ts=result.start_ts, end_ts=result.end_ts, status=result.status)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user