diff options
| author | 2014-12-20 14:24:13 +0100 | |
|---|---|---|
| committer | 2014-12-20 14:24:13 +0100 | |
| commit | 6325eda4e8c142edd11c747f7a9d4a3fa975c494 (patch) | |
| tree | 589819bb5e5ce441ea8f1109c8357c086816ed69 | |
| parent | [AlldebridCom] Syntax fixup (diff) | |
| download | pyload-6325eda4e8c142edd11c747f7a9d4a3fa975c494.tar.xz | |
Fix password retrieving in some plugins
| -rw-r--r-- | module/plugins/hoster/BasePlugin.py | 9 | ||||
| -rw-r--r-- | module/plugins/hoster/FilepostCom.py | 17 | ||||
| -rw-r--r-- | module/plugins/hoster/FshareVn.py | 15 | ||||
| -rw-r--r-- | module/plugins/hoster/Ftp.py | 9 | ||||
| -rw-r--r-- | module/plugins/hoster/MediafireCom.py | 15 | ||||
| -rw-r--r-- | module/plugins/hoster/MegaCoNz.py | 10 | ||||
| -rw-r--r-- | module/plugins/hoster/RealdebridCom.py | 12 | ||||
| -rw-r--r-- | module/plugins/hoster/UlozTo.py | 15 | 
8 files changed, 54 insertions, 48 deletions
| diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 7b59303ef..d0d8e7cc8 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster  class BasePlugin(Hoster):      __name__    = "BasePlugin"      __type__    = "hoster" -    __version__ = "0.25" +    __version__ = "0.26"      __pattern__ = r'^unmatchable$' @@ -60,10 +60,9 @@ class BasePlugin(Hoster):                          self.logDebug("Logging on to %s" % server)                          self.req.addAuth(account.accounts[server]['password'])                      else: -                        for pwd in self.getPassword().splitlines(): -                            if ":" in pwd: -                                self.req.addAuth(pwd.strip()) -                                break +                        pwd = self.getPassword() +                        if ':' in pwd: +                            self.req.addAuth(pwd)                          else:                              self.fail(_("Authorization required"))                  else: diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index b94892ef4..66c040770 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class FilepostCom(SimpleHoster):      __name__    = "FilepostCom"      __type__    = "hoster" -    __version__ = "0.30" +    __version__ = "0.31"      __pattern__ = r'https?://(?:www\.)?(?:filepost\.com/files|fp\.io)/(?P<ID>[^/]+)' @@ -52,17 +52,20 @@ class FilepostCom(SimpleHoster):          if 'var is_pass_exists = true;' in self.html:              # Solve password -            for file_pass in self.getPassword().splitlines(): +            password = self.getPassword() + +            if password: +                self.logInfo(_("Password protected link, trying ") + file_pass) +                  get_dict['JsHttpRequest'] = str(int(time() * 10000)) + '-xml'                  post_dict['file_pass'] = file_pass -                self.logInfo(_("Password protected link, trying ") + file_pass) -                download_url = self.getJsonResponse(get_dict, post_dict, 'link') -                if download_url: -                    break +                self.link = self.getJsonResponse(get_dict, post_dict, 'link') +                if not self.link: +                    self.fail(_("Incorrect password"))              else: -                self.fail(_("No or incorrect password")) +                self.fail(_("No password found"))          else:              # Solve recaptcha diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 3c230bbe2..7b8e4b0bd 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -24,7 +24,7 @@ def doubleDecode(m):  class FshareVn(SimpleHoster):      __name__    = "FshareVn"      __type__    = "hoster" -    __version__ = "0.17" +    __version__ = "0.18"      __pattern__ = r'http://(?:www\.)?fshare\.vn/file/.*' @@ -66,15 +66,20 @@ class FshareVn(SimpleHoster):          if not inputs:              self.error(_("No FORM")) +          elif 'link_file_pwd_dl' in inputs: -            for password in self.getPassword().splitlines(): +            password = self.getPassword() + +            if password:                  self.logInfo(_("Password protected link, trying ") + password)                  inputs['link_file_pwd_dl'] = password                  self.html = self.load(self.url, post=inputs, decode=True) -                if not 'name="link_file_pwd_dl"' in self.html: -                    break + +                if 'name="link_file_pwd_dl"' in self.html: +                    self.fail(_("Incorrect password"))              else: -                self.fail(_("No or incorrect password")) +                self.fail(_("No password found")) +          else:              self.html = self.load(self.url, post=inputs, decode=True) diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 9f79d80b5..c6ad68e49 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -12,7 +12,7 @@ from module.plugins.Hoster import Hoster  class Ftp(Hoster):      __name__    = "Ftp"      __type__    = "hoster" -    __version__ = "0.43" +    __version__ = "0.44"      __pattern__ = r'(?:ftps?|sftp)://([\w.-]+(:[\w.-]+)?@)?[\w.-]+(:\d+)?/.+' @@ -45,10 +45,9 @@ class Ftp(Hoster):                  self.logDebug("Logging on to %s" % netloc)                  self.req.addAuth(self.account.accounts[netloc]['password'])              else: -                for pwd in self.getPassword().splitlines(): -                    if ":" in pwd: -                        self.req.addAuth(pwd.strip()) -                        break +                pwd = self.getPassword() +                if ':' in pwd: +                    self.req.addAuth(pwd)          self.req.http.c.setopt(pycurl.NOBODY, 1) diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index cdfa410a9..4b420242d 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -49,7 +49,7 @@ def getInfo(urls):  class MediafireCom(SimpleHoster):      __name__    = "MediafireCom"      __type__    = "hoster" -    __version__ = "0.80" +    __version__ = "0.81"      __pattern__ = r'http://(?:www\.)?mediafire\.com/(file/|(view/?|download\.php)?\?)(\w{11}|\w{15})($|/)' @@ -98,14 +98,17 @@ class MediafireCom(SimpleHoster):      def handleFree(self): -        passwords = self.getPassword().splitlines() -        while self.PASSWORD_PATTERN in self.html: -            if len(passwords): -                password = passwords.pop(0) +        if self.PASSWORD_PATTERN in self.html: +            password = self.getPassword() + +            if password:                  self.logInfo(_("Password protected link, trying ") + password)                  self.html = self.load(self.url, post={"downloadp": password}) + +                if self.PASSWORD_PATTERN in self.html: +                    self.fail(_("Incorrect password"))              else: -                self.fail(_("No or incorrect password")) +                self.fail(_("No password found"))          m = re.search(r'kNO = r"(http://.*?)";', self.html)          if m is None: diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 385295d42..fc6724dc7 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -46,9 +46,9 @@ from module.plugins.Hoster import Hoster  class MegaCoNz(Hoster):      __name__    = "MegaCoNz"      __type__    = "hoster" -    __version__ = "0.16" +    __version__ = "0.17" -    __pattern__ = r'https?://(\w+\.)?mega\.co\.nz/#!([\w!-]+)' +    __pattern__ = r'https?://(?:www\.)?mega\.co\.nz/#!(?P<ID>[\w!-]+)'      __description__ = """Mega.co.nz hoster plugin"""      __license__     = "GPLv3" @@ -133,11 +133,11 @@ class MegaCoNz(Hoster):          key = None          # match is guaranteed because plugin was chosen to handle url -        node = re.match(self.__pattern__, pyfile.url).group(2) +        node = re.match(self.__pattern__, pyfile.url).group('ID')          if "!" in node: -            node, key = node.split("!") +            node, key = node.split("!", 1) -        self.logDebug("File id: %s | Key: %s" % (node, key)) +        self.logDebug("ID: %s | Key: %s" % (node, key))          if not key:              self.fail(_("No file key provided in the URL")) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index e624d1f34..bec0b820c 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -14,7 +14,7 @@ from module.utils import parseFileSize  class RealdebridCom(SimpleHoster):      __name__    = "RealdebridCom"      __type__    = "hoster" -    __version__ = "0.55" +    __version__ = "0.56"      __pattern__ = r'https?://(?:[^/]*\.)?real-debrid\..*' @@ -42,16 +42,10 @@ class RealdebridCom(SimpleHoster):      def handleMulti(self): -        password = self.getPassword().splitlines() -        if not password: -            password = "" -        else: -            password = password[0] - -       data = json_loads(self.load("https://real-debrid.com/ajax/unrestrict.php", +        data = json_loads(self.load("https://real-debrid.com/ajax/unrestrict.php",                                      get={'lang'    : "en",                                           'link'    : quote(self.pyfile.url, ""), -                                         'password': password, +                                         'password': self.getPassword(),                                           'time'    : int(time() * 1000)}))          self.logDebug("Returned Data: %s" % data) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 262b37c21..8fa58d48b 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -15,7 +15,7 @@ def convertDecimalPrefix(m):  class UlozTo(SimpleHoster):      __name__    = "UlozTo"      __type__    = "hoster" -    __version__ = "1.00" +    __version__ = "1.01"      __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P<id>\w+/[^/?]*)' @@ -60,15 +60,18 @@ class UlozTo(SimpleHoster):              self.html = self.load(pyfile.url, get={"do": "askAgeForm-submit"},                                    post={"agree": "Confirm", "_token_": token}, cookies=True) -        passwords = self.getPassword().splitlines() -        while self.PASSWD_PATTERN in self.html: -            if passwords: -                password = passwords.pop(0) +        if self.PASSWD_PATTERN in self.html: +            password = self.getPassword() + +            if password:                  self.logInfo(_("Password protected link, trying ") + password)                  self.html = self.load(pyfile.url, get={"do": "passwordProtectedForm-submit"},                                        post={"password": password, "password_send": 'Send'}, cookies=True) + +                if self.PASSWD_PATTERN in self.html: +                    self.fail(_("Incorrect password"))              else: -                self.fail(_("No or incorrect password")) +                self.fail(_("No password found"))          if re.search(self.VIPLINK_PATTERN, self.html):              self.html = self.load(pyfile.url, get={"disclaimer": "1"}) | 
