diff --git a/.env.example b/.env.example index 00089a3fb..9814e3f03 100644 --- a/.env.example +++ b/.env.example @@ -160,6 +160,7 @@ TEMP_UNZIP_PATH='/var/www/nntmux/resources/tmp/unzip/' VIEW_COMPILED_PATH=/var/www/NNTmux/storage/framework/views UNRAR_PATH= UNZIP_PATH= +S7ZIP_PATH= PATH_TO_NZBS= FFMPEG_PATH= LAME_PATH= diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index bde74815c..7dc6455a0 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -80,6 +80,10 @@ class ProcessAdditional */ protected mixed $_unrarPath; + protected mixed $_unzipPath; + + protected mixed $_7zipPath; + protected string $_killString; protected string|bool $_showCLIReleaseID; @@ -283,11 +287,12 @@ class ProcessAdditional $this->_maxNestedLevels = (int) Settings::settingValue('maxnestedlevels') === 0 ? 3 : (int) Settings::settingValue('maxnestedlevels'); $this->_extractUsingRarInfo = (int) Settings::settingValue('extractusingrarinfo') !== 0; $this->_fetchLastFiles = (int) Settings::settingValue('archive.fetch.end') !== 0; - $this->_unrarPath = false; + $this->_unrarPath = config('nntmux_settings.unrar_path'); + $this->_unzipPath = config('nntmux_settings.unzip_path'); + $this->_7zipPath = config('nntmux_settings.7zip_path'); // Pass the binary extractors to ArchiveInfo. $clients = []; - $this->_unrarPath = config('nntmux_settings.unrar_path'); $clients += [ArchiveInfo::TYPE_RAR => $this->_unrarPath]; $this->_archiveInfo->setExternalClients($clients); @@ -928,7 +933,7 @@ class ProcessAdditional $fileName = $this->tmpPath.uniqid('', true).'.zip'; File::put($fileName, $compressedData); // Use the unzip command instead of 7zip - runCmd('unzip -o "'.$fileName.'" -d "'.$this->tmpPath.'unzip/"'); + runCmd($this->_unzipPath.' -o "'.$fileName.'" -d "'.$this->tmpPath.'unzip/"'); File::delete($fileName); } break; diff --git a/config/nntmux_settings.php b/config/nntmux_settings.php index 1bfd41399..5822ee2c1 100644 --- a/config/nntmux_settings.php +++ b/config/nntmux_settings.php @@ -2,7 +2,8 @@ return [ 'unrar_path' => env('UNRAR_PATH', '/usr/bin/unrar'), - 'unzip_path' => env('UNZIP_PATH', '/usr/bin/7z'), + 'unzip_path' => env('UNZIP_PATH', '/usr/bin/unzip'), + '7zip_path' => env('S7ZIP_PATH', '/usr/bin/7z'), 'check_passworded_rars' => env('CHECK_PASSWORDED_RARS', false), 'delete_passworded_releases' => env('DELETE_PASSWORDED_RELEASES', false), 'delete_possible_passworded_releases' => env('DELETE_POSSIBLE_PASSWORDED_RELEASES', false),