summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/SendspaceCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-10 03:02:26 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-10 03:02:26 +0200
commit04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 (patch)
tree703010e32f62bf869551ce0d323dacf62bc448ff /module/plugins/hoster/SendspaceCom.py
parent[SimpleCrypter] Support parseError (diff)
downloadpyload-04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8.tar.xz
Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics
Diffstat (limited to 'module/plugins/hoster/SendspaceCom.py')
-rw-r--r--module/plugins/hoster/SendspaceCom.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py
index 8b6c9781a..e441a594d 100644
--- a/module/plugins/hoster/SendspaceCom.py
+++ b/module/plugins/hoster/SendspaceCom.py
@@ -30,17 +30,19 @@ class SendspaceCom(SimpleHoster):
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- DOWNLOAD_URL_PATTERN = r'<a id="download_button" href="([^"]+)"'
FILE_NAME_PATTERN = r'<h2 class="bgray">\s*<(?:b|strong)>(?P<N>[^<]+)</'
FILE_SIZE_PATTERN = r'<div class="file_description reverse margin_center">\s*<b>File Size:</b>\s*(?P<S>[0-9.]+)(?P<U>[kKMG])i?B\s*</div>'
OFFLINE_PATTERN = r'<div class="msg error" style="cursor: default">Sorry, the file you requested is not available.</div>'
+
+ LINK_PATTERN = r'<a id="download_button" href="([^"]+)"'
CAPTCHA_PATTERN = r'<td><img src="(/captchas/captcha.php?captcha=([^"]+))"></td>'
USER_CAPTCHA_PATTERN = r'<td><img src="/captchas/captcha.php?user=([^"]+))"></td>'
+
def handleFree(self):
params = {}
for _ in xrange(3):
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
+ found = re.search(self.LINK_PATTERN, self.html)
if found:
if 'captcha_hash' in params:
self.correctCaptcha()