From b13b8881d51008e857718fec9fea4e9fe127fe77 Mon Sep 17 00:00:00 2001 From: cookie99999 <77994115+cookie99999@users.noreply.github.com> Date: Fri, 12 May 2023 14:38:03 -0400 Subject: [PATCH] Allow unrar to overwrite files On systems without the appropriate 7zip functionality, corrupt files will be created in the working directory, causing unrar to fail as its default behavior is to disallow overwriting files with the same names. --- kindlecomicconverter/comicarchive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kindlecomicconverter/comicarchive.py b/kindlecomicconverter/comicarchive.py index dcaec36..46b2b3a 100644 --- a/kindlecomicconverter/comicarchive.py +++ b/kindlecomicconverter/comicarchive.py @@ -57,7 +57,7 @@ class ComicArchive: self.filepath + '"', stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True) process.communicate() if process.returncode != 0: - process = Popen('unrar x -y -x__MACOSX -x.DS_Store -xthumbs.db -xThumbs.db "' + self.filepath + '" "' + + process = Popen('unrar x -y -o+ -x__MACOSX -x.DS_Store -xthumbs.db -xThumbs.db "' + self.filepath + '" "' + targetdir + '"', stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True) process.communicate() if process.returncode != 0: