diff --git a/core/archive_util.js b/core/archive_util.js index f1bf70df..02a2e283 100644 --- a/core/archive_util.js +++ b/core/archive_util.js @@ -265,7 +265,7 @@ module.exports = class ArchiveUtil { while((m = entryMatchRe.exec(output))) { entries.push({ byteSize : parseInt(m[entryGroupOrder.byteSize]), - fileName : m[entryGroupOrder.fileName], + fileName : m[entryGroupOrder.fileName].trim(), }); } diff --git a/core/config.js b/core/config.js index 755cc56c..adf82630 100644 --- a/core/config.js +++ b/core/config.js @@ -305,6 +305,22 @@ function getDefaultConfig() { cmd : 'arj', args : [ 'e', '{archivePath}', '{extractPath}', '{fileList}' ], } + }, + + Rar : { + decompress : { + cmd : 'unrar', + args : [ 'x', '{archivePath}', '{extractPath}' ], + }, + list : { + cmd : 'unrar', + args : [ 'l', '{archivePath}' ], + entryMatch : '^\\s+[\\.A-Z]+\\s+([\\d]+)\\s{2}[0-9]{2}\\-[0-9]{2}\\-[0-9]{2}\\s[0-9]{2}\\:[0-9]{2}\\s{2}([^\\r\\n]+)$', + }, + extract : { + cmd : 'unrar', + args : [ 'e', '{archivePath}', '{extractPath}', '{fileList}' ], + } } }, @@ -338,7 +354,7 @@ function getDefaultConfig() { sig : '526172211a0700', offset : 0, exts : [ 'rar' ], - handler : '7Zip', + handler : 'Rar', desc : 'RAR Archive', }, gzip : { @@ -483,12 +499,12 @@ function getDefaultConfig() { // These are NOT case sensitive // FILE_ID.DIZ - https://en.wikipedia.org/wiki/FILE_ID.DIZ desc : [ - '^FILE_ID\.DIZ$', '^DESC\.SDI$', '^DESCRIPT\.ION$', '^FILE\.DES$', '$FILE\.SDI$', '^DISK\.ID$' + '^[^/\]*FILE_ID\.DIZ$', '^[^/\]*DESC\.SDI$', '^[^/\]*DESCRIPT\.ION$', '^[^/\]*FILE\.DES$', '^[^/\]*FILE\.SDI$', '^[^/\]*DISK\.ID$' ], // common README filename - https://en.wikipedia.org/wiki/README descLong : [ - '^.*\.NFO$', '^README\.1ST$', '^README\.NOW$', '^README\.TXT$', '^READ\.ME$', '^README$', '^README\.md$' + '^[^/\]*\.NFO$', '^[^/\]*README\.1ST$', '^[^/\]*README\.NOW$', '^[^/\]*README\.TXT$', '^[^/\]*READ\.ME$', '^[^/\]*README$', '^[^/\]*README\.md$' ], },