From ff292b6e3fc68e503356bff35e0105c959dc00a9 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 14 Dec 2022 15:14:50 -0700 Subject: [PATCH] Increasing Singlefile header size because some URLs may be very long. --- modules/archive/lib.py | 2 +- modules/archive/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/archive/lib.py b/modules/archive/lib.py index 453828ea..aa7f911a 100644 --- a/modules/archive/lib.py +++ b/modules/archive/lib.py @@ -507,7 +507,7 @@ def is_singlefile_file(path: pathlib.Path) -> bool: return True with path.open('rt') as fh: # Lastly, try to read the header of this HTML file. - header = fh.read(500) + header = fh.read(1000) if SINGLEFILE_HEADER in header: return True return False diff --git a/modules/archive/models.py b/modules/archive/models.py index 7a715249..4a8b86b6 100644 --- a/modules/archive/models.py +++ b/modules/archive/models.py @@ -149,7 +149,7 @@ class Archive(Base, ModelHelper): raise ValueError('Cannot read singlefile data when this has no files') with path.open('rt') as fh: - head = fh.read(500) + head = fh.read(1000) if 'Page saved with SingleFile' not in head: return try: