diff --git a/sabnzbd/utils/file_extension.py b/sabnzbd/utils/file_extension.py index 79aa984..5432ac3 100644 --- a/sabnzbd/utils/file_extension.py +++ b/sabnzbd/utils/file_extension.py @@ -264,9 +264,12 @@ def what_is_most_likely_extension(file_path: str) -> str: # Check if text or NZB, as puremagic is not good at that. try: - txt = Path(file_path).read_text() + # Only read the start, don't need the whole file + with open(file_path, "r") as inp_file: + txt = inp_file.read(200).lower() + # Yes, a text file ... so let's check if it's even an NZB: - if txt.lower().find("= 0: + if "!doctype nzb public" in txt or "