From af9084ee955e3ff4c4b6231d575603c45354be26 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 28 Jul 2020 05:55:09 -0400 Subject: [PATCH] update Snapshot.title to latest_title after fetching --- archivebox/extractors/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/archivebox/extractors/__init__.py b/archivebox/extractors/__init__.py index ce51d4f8..b468ce03 100644 --- a/archivebox/extractors/__init__.py +++ b/archivebox/extractors/__init__.py @@ -85,6 +85,13 @@ def archive_link(link: Link, overwrite: bool=False, out_dir: Optional[str]=None) # print(' ', stats) + try: + latest_title = link.history['title'][-1].output.strip() + if latest_title and len(latest_title) >= len(link.title or ''): + link = link.overwrite(title=latest_title) + except Exception: + pass + write_link_details(link, out_dir=link.link_dir) patch_main_index(link)