summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/UnRar.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/internal/UnRar.py')
-rw-r--r--module/plugins/internal/UnRar.py36
1 files changed, 13 insertions, 23 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index e3765602b..19c278735 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -1,37 +1,27 @@
# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: RaNaN
-"""
-
import os
import re
-from os.path import join
+
from glob import glob
-from subprocess import Popen, PIPE
+from os.path import join
from string import digits
+from subprocess import Popen, PIPE
-from module.utils import save_join, decode
from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError, CRCError
+from module.utils import save_join, decode
class UnRar(AbtractExtractor):
__name__ = "UnRar"
__version__ = "0.16"
+ __description__ = """Rar extractor plugin"""
+ __author_name__ = "RaNaN"
+ __author_mail__ = "RaNaN@pyload.org"
+
+ CMD = "unrar"
+
# there are some more uncovered rar formats
re_version = re.compile(r"(UNRAR 5[\.\d]+(.*?)freeware)")
re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$", re.I)
@@ -39,7 +29,7 @@ class UnRar(AbtractExtractor):
re_filelist = re.compile(r"(.+)\s+(\d+)\s+(\d+)\s+")
re_filelist5 = re.compile(r"(.+)\s+(\d+)\s+\d\d-\d\d-\d\d\s+\d\d:\d\d\s+(.+)")
re_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)", re.I)
- CMD = "unrar"
+
@staticmethod
def checkDeps():
@@ -200,8 +190,8 @@ class UnRar(AbtractExtractor):
args.append("-y")
# set a password
- if "password" in kwargs and kwargs["password"]:
- args.append("-p%s" % kwargs["password"])
+ if "password" in kwargs and kwargs['password']:
+ args.append("-p%s" % kwargs['password'])
else:
args.append("-p-")