From 1eca209b85eb714fb112c9f65916fa383d206578 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Jan 2015 02:50:49 +0100 Subject: [RelinkUs] Improve unlockPasswordProtection --- module/plugins/crypter/RelinkUs.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 5933839ec..5a3eca803 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -56,9 +56,8 @@ class RelinkUs(Crypter): def setup(self): - self.fileid = None + self.fileid = None self.package = None - self.password = None self.captcha = False @@ -102,7 +101,6 @@ class RelinkUs(Crypter): def initPackage(self, pyfile): self.fileid = re.match(self.__pattern__, pyfile.url).group('ID') self.package = pyfile.package() - self.password = self.getPassword() def requestPackage(self): @@ -130,10 +128,14 @@ class RelinkUs(Crypter): def unlockPasswordProtection(self): - self.logDebug("Submitting password [%s] for protected links" % self.password) - passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid - passwd_data = {'id': self.fileid, 'password': self.password, 'pw': 'submit'} - self.html = self.load(passwd_url, post=passwd_data, decode=True) + password = self.getPassword() + + self.logDebug("Submitting password [%s] for protected links" % password) + + if password: + passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid + passwd_data = {'id': self.fileid, 'password': password, 'pw': 'submit'} + self.html = self.load(passwd_url, post=passwd_data, decode=True) def unlockCaptchaProtection(self): -- cgit v1.2.3