diff options
Diffstat (limited to 'module/plugins/hoster')
| -rw-r--r-- | module/plugins/hoster/FileserveCom.py | 22 | ||||
| -rw-r--r-- | module/plugins/hoster/UploadedTo.py | 35 | 
2 files changed, 20 insertions, 37 deletions
| diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index f8cf652b9..534b6bf7e 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -39,21 +39,23 @@ class FileserveCom(Hoster):      __description__ = """Fileserve.com hoster plugin"""      __license__     = "GPLv3" -    __authors__     = [("jeix", "jeix@hasnomail.de"), -                       ("mkaay", "mkaay@mkaay.de"), -                       ("Paul King", None), -                       ("zoidberg", "zoidberg@mujmail.cz")] +    __authors__     = [("jeix"     , "jeix@hasnomail.de"  ), +                       ("mkaay"    , "mkaay@mkaay.de"     ), +                       ("Paul King", None                 ), +                       ("zoidberg" , "zoidberg@mujmail.cz")] -    URLS = ["http://www.fileserve.com/file/", "http://www.fileserve.com/link-checker.php", +    URLS = ["http://www.fileserve.com/file/", +            "http://www.fileserve.com/link-checker.php",              "http://www.fileserve.com/checkReCaptcha.php"] +      LINKCHECK_TR = r'<tr>\s*(<td>http://www\.fileserve\.com/file/.*?)</tr>'      LINKCHECK_TD = r'<td>(?:<.*?>| )*([^<]*)' -    CAPTCHA_KEY_PATTERN = r'var reCAPTCHA_publickey=\'(.+?)\'' -    LONG_WAIT_PATTERN = r'<li class="title">You need to wait (\d+) (\w+) to start another download\.</li>' -    LINK_EXPIRED_PATTERN = r'Your download link has expired' -    DAILY_LIMIT_PATTERN = r'Your daily download limit has been reached' +    CAPTCHA_KEY_PATTERN   = r'var reCAPTCHA_publickey=\'(.+?)\'' +    LONG_WAIT_PATTERN     = r'<li class="title">You need to wait (\d+) (\w+) to start another download\.</li>' +    LINK_EXPIRED_PATTERN  = r'Your download link has expired' +    DL_LIMIT_PATTERN      = r'Your daily download limit has been reached'      NOT_LOGGED_IN_PATTERN = r'<form (name="loginDialogBoxForm"|id="login_form")|<li><a href="/login\.php">Login</a></li>' @@ -119,7 +121,7 @@ class FileserveCom(Hoster):          check = self.checkDownload({"expired": self.LINK_EXPIRED_PATTERN,                                      "wait"   : re.compile(self.LONG_WAIT_PATTERN), -                                    "limit"  : self.DAILY_LIMIT_PATTERN}) +                                    "limit"  : self.DL_LIMIT_PATTERN})          if check == "expired":              self.logDebug("Download link was expired") diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 4db160ab4..9c13b86dc 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class UploadedTo(SimpleHoster):      __name__    = "UploadedTo"      __type__    = "hoster" -    __version__ = "0.92" +    __version__ = "0.93"      __pattern__ = r'https?://(?:www\.)?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P<ID>\w+)'      __config__  = [("use_premium", "bool", "Use premium account if available", True)] @@ -25,14 +25,15 @@ class UploadedTo(SimpleHoster):      CHECK_TRAFFIC = True      DISPOSITION   = False -    API_KEY = "lhF2IeeprweDfu9ccWlxXVVypA5nA3EL" -      URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://uploaded.net/file/\g<ID>')] +    API_KEY = "lhF2IeeprweDfu9ccWlxXVVypA5nA3EL" +      TEMP_OFFLINE_PATTERN = r'<title>uploaded\.net - Maintenance' +    LINK_PREMIUM_PATTERN = r'<div class="tfree".*\s*<form method="post" action="(.+?)"' -    WAIT_PATTERN   = r'Current waiting period: <span>(\d+)' -    DL_LIMIT_ERROR = r'You have reached the max. number of possible free downloads for this hour' +    WAIT_PATTERN     = r'Current waiting period: <span>(\d+)' +    DL_LIMIT_PATTERN = r'You have reached the max. number of possible free downloads for this hour'      @classmethod @@ -62,18 +63,6 @@ class UploadedTo(SimpleHoster):          self.chunkLimit = 1  # critical problems with more chunks -    def checkErrors(self): -        if 'var free_enabled = false;' in self.html: -            self.logError(_("Free-download capacities exhausted")) -            self.retry(24, 5 * 60) - -        return super(UploadedTo, self).checkErrors() - - -    def handlePremium(self, pyfile): -        self.link = urlparse.urljoin(pyfile.url, "/ddl?pw=" + self.getPassword()) - -      def handleFree(self, pyfile):          self.load("http://uploaded.net/language/en", just_header=True) @@ -87,20 +76,12 @@ class UploadedTo(SimpleHoster):                                      'recaptcha_response_field' : response})          if "type:'download'" in self.html: -            self.correctCaptcha()              try: -                self.link = re.search("url:'(.+?)'", self.html).group(1) - +                self.link = re.search("url:\s*'(.+?)'", self.html).group(1)              except Exception:                  pass - -    def checkFile(self, rules={}): -        if self.checkDownload({'limit-dl': self.DL_LIMIT_ERROR}): -            self.wait(3 * 60 * 60, True) -            self.retry() - -        return super(UploadedTo, self).checkFile(rules) +        self.checkErrors()  getInfo = create_getInfo(UploadedTo) | 
