mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-21 05:41:54 +02:00
fix: Invalid file path being generated on add
This commit is contained in:
@@ -213,7 +213,6 @@ class Snapshot(models.Model):
|
|||||||
return self.history['title'][-1].output.strip()
|
return self.history['title'][-1].output.strip()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def domain(self) -> str:
|
def domain(self) -> str:
|
||||||
from ..util import domain
|
from ..util import domain
|
||||||
|
@@ -576,7 +576,7 @@ def add(urls: Union[str, List[str]],
|
|||||||
log_crawl_started(new_snapshots)
|
log_crawl_started(new_snapshots)
|
||||||
for new_snapshot in new_snapshots:
|
for new_snapshot in new_snapshots:
|
||||||
# TODO: Check if we need to add domain to the Snapshot model
|
# TODO: Check if we need to add domain to the Snapshot model
|
||||||
downloaded_file = save_file_as_source(new_snapshot.url, filename=f'{new_snapshot.timestamp}-crawl-{new_snapshot.url}.txt', out_dir=out_dir)
|
downloaded_file = save_file_as_source(new_snapshot.url, filename=f'{new_snapshot.timestamp}-crawl-{new_snapshot.domain}.txt', out_dir=out_dir)
|
||||||
new_snapshots_depth += parse_snapshots_from_source(downloaded_file, root_url=new_snapshot.url)
|
new_snapshots_depth += parse_snapshots_from_source(downloaded_file, root_url=new_snapshot.url)
|
||||||
|
|
||||||
imported_snapshots = [Snapshot(url=snapshot.url) for snapshot in new_snapshots + new_snapshots_depth]
|
imported_snapshots = [Snapshot(url=snapshot.url) for snapshot in new_snapshots + new_snapshots_depth]
|
||||||
|
Reference in New Issue
Block a user