From 903a833fcec3eba62654a0b10583f76a93cb1a53 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 7 May 2024 08:28:15 -0700 Subject: [PATCH] Use mtime from files.xml if no Last-Modified header is available --- HISTORY.rst | 7 +++++++ internetarchive/__version__.py | 2 +- internetarchive/files.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 9ff2ca95..bf39b370 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,13 @@ Release History --------------- +4.1.0 (?) ++++++++++ + +**Bugfixes** + +- Use mtime from files.xml if no Last-Modified header is available (e.g. VTT files). + 4.0.1 (2024-04-15) ++++++++++++++++++ diff --git a/internetarchive/__version__.py b/internetarchive/__version__.py index 1a3bef53..4658fd53 100644 --- a/internetarchive/__version__.py +++ b/internetarchive/__version__.py @@ -1 +1 @@ -__version__ = '4.0.1' +__version__ = '4.1.0.dev1' diff --git a/internetarchive/files.py b/internetarchive/files.py index 4981651e..020b9fa9 100644 --- a/internetarchive/files.py +++ b/internetarchive/files.py @@ -252,7 +252,7 @@ def download(# noqa: max-complexity=38 dt = parsedate_to_datetime(last_mod_header) last_mod_mtime = dt.timestamp() else: - last_mod_mtime = 0 + last_mod_mtime = self.mtime response.raise_for_status()