diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-02-09 17:21:07 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-02-09 17:21:07 +0100 |
commit | 5b87dd18c173fa02574d97b7c1680c95f8d69424 (patch) | |
tree | 3f4114c8ad51a19de15429898aa2015f1e88a2f0 | |
parent | filefactory premium, uloz.to new url pattern (diff) | |
download | pyload-5b87dd18c173fa02574d97b7c1680c95f8d69424.tar.xz |
closed #534 - pyload crash, depositfiles 20gb limit workaround
-rw-r--r-- | module/plugins/hoster/DepositfilesCom.py | 19 | ||||
-rw-r--r-- | module/plugins/hoster/IfolderRu.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/Share4webCom.py | 16 | ||||
-rw-r--r-- | module/setup.py | 19 |
4 files changed, 39 insertions, 19 deletions
diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index c5cca6409..ede21e9ee 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -11,7 +11,7 @@ class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?depositfiles\.com(/\w{1,3})?/files/[\w]+" - __version__ = "0.37" + __version__ = "0.38" __description__ = """Depositfiles.com Download Hoster""" __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") @@ -19,12 +19,16 @@ class DepositfilesCom(SimpleHoster): FILE_INFO_PATTERN = r'File name: <b title="(?P<N>[^"]+)">.*\s*<span class="nowrap">File size: <b>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</b>' FILE_OFFLINE_PATTERN = r'<span class="html_download_api-not_exists"></span>' FILE_URL_REPLACEMENTS = [(r"\.com(/.*?)?/files", ".com/en/files"), (r"\.html$", "")] - + RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)', this\);" DOWNLOAD_LINK_PATTERN = r'<form action="(http://.+?\.depositfiles.com/.+?)" method="get"' + def setup(self): + self.multiDL = False + self.resumeDownload = self.premium + def handleFree(self): - self.html = self.load(self.pyfile.url, post={"gateway_result":"1"}) + self.html = self.load(self.pyfile.url, post={"gateway_result":"1"}, cookies = True) if re.search(self.FILE_OFFLINE_PATTERN, self.html): self.offline() if re.search(r'File is checked, please try again in a minute.', self.html) is not None: @@ -67,7 +71,7 @@ class DepositfilesCom(SimpleHoster): for i in range(5): self.html = self.load("http://depositfiles.com/get_file.php", get = params) - + if '<input type=button value="Continue" onclick="check_recaptcha' in self.html: if not captcha_key: raise PluginParseError('Captcha key') if 'response' in params: self.invalidCaptcha() @@ -92,7 +96,14 @@ class DepositfilesCom(SimpleHoster): self.retry(wait_time = 60) def handlePremium(self): + if '<span class="html_download_api-gold_traffic_limit">' in self.html: + self.logWarning("Download limit reached") + self.retry(25, 3600, "Download limit reached") + elif 'onClick="show_gold_offer' in self.html: + self.account.relogin() + self.retry() link = unquote(re.search('<div id="download_url">\s*<a href="(http://.+?\.depositfiles.com/.+?)"', self.html).group(1)) + self.multiDL = True self.download(link) getInfo = create_getInfo(DepositfilesCom)
\ No newline at end of file diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index 83b98ecc9..aac7be7dd 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -24,8 +24,8 @@ from module.network.RequestFactory import getURL class IfolderRu(SimpleHoster): __name__ = "IfolderRu" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)?ifolder.ru/(\d+).*" - __version__ = "0.33" + __pattern__ = r"http://(?:[^.]*\.)?ifolder.ru/(\d+).*" + __version__ = "0.34" __description__ = """ifolder.ru""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") diff --git a/module/plugins/hoster/Share4webCom.py b/module/plugins/hoster/Share4webCom.py new file mode 100644 index 000000000..ef9c2acf8 --- /dev/null +++ b/module/plugins/hoster/Share4webCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.hoster.UnibytesCom import UnibytesCom +from module.plugins.internal.SimpleHoster import create_getInfo + +class Share4webCom(UnibytesCom): + __name__ = "Share4webCom" + __type__ = "hoster" + __pattern__ = r"http://(www\.)?share4web\.com/get/\w+" + __version__ = "0.1" + __description__ = """Share4web.com""" + __author_name__ = ("zoidberg") + + DOMAIN = 'http://www.share4web.com' + +getInfo = create_getInfo(UnibytesCom)
\ No newline at end of file diff --git a/module/setup.py b/module/setup.py index f90afe23a..42b24859f 100644 --- a/module/setup.py +++ b/module/setup.py @@ -460,23 +460,16 @@ class Setup(): p1 = True p2 = False while p1 != p2: - if os.name == "nt": - qst = str("Password: ") #no unicode on windows - else: - qst = _("Password: ") - - p1 = getpass(qst.encode("utf-8")) + # getpass(_("Password: ")) will crash on systems with broken locales (Win, NAS) + sys.stdout.write(_("Password: ")) + p1 = getpass("") if len(p1) < 4: - print _("Password to short. Use at least 4 symbols.") + print _("Password too short. Use at least 4 symbols.") continue - if os.name == "nt": - qst = str("Password (again): ") - else: - qst = _("Password (again): ") - - p2 = getpass(qst.encode("utf-8")) + sys.stdout.write(_("Password (again): ")) + p2 = getpass("") if p1 == p2: return p1 |