From 44f55ede402c5f24791b9da9a45b7947a930861b Mon Sep 17 00:00:00 2001 From: Feramance Date: Mon, 9 Oct 2023 11:52:21 +0200 Subject: [PATCH] [release] File extension regex update --- qBitrr/arss.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qBitrr/arss.py b/qBitrr/arss.py index 597ce4d4..a96bb856 100755 --- a/qBitrr/arss.py +++ b/qBitrr/arss.py @@ -138,6 +138,13 @@ def __init__( self.file_extension_allowlist = CONFIG.get( f"{name}.Torrent.FileExtensionAllowlist", fallback=[] ) + self.logger.debug("file_extension_allowlist: ", self.file_extension_allowlist) + for ext in self.file_extension_allowlist: + if ext[0] != "\\": + self.file_extension_allowlist[self.file_extension_allowlist.index(ext)] = ( + "\\" + ext + ) + self.logger.debug("file_extension_allowlist: ", self.file_extension_allowlist) self.auto_delete = CONFIG.get(f"{name}.Torrent.AutoDelete", fallback=False) self.remove_dead_trackers = CONFIG.get( @@ -2933,7 +2940,11 @@ def _process_single_torrent_process_files( total -= 1 elif ( self.file_extension_allowlist - and file_path.suffix.lower() not in self.file_extension_allowlist + and ( + (match := self.file_extension_allowlist.search(file_path.suffix)) + and match.group() + ) + # and file_path.suffix.lower() not in self.file_extension_allowlist ): self.logger.debug( "Removing File: Not allowed | Extension: %s | %s (%s) | %s ",