summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/UpstoreNet.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/hoster/UpstoreNet.py')
-rw-r--r--pyload/plugins/hoster/UpstoreNet.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/pyload/plugins/hoster/UpstoreNet.py b/pyload/plugins/hoster/UpstoreNet.py
index 2f05d6ffa..255526aa2 100644
--- a/pyload/plugins/hoster/UpstoreNet.py
+++ b/pyload/plugins/hoster/UpstoreNet.py
@@ -7,17 +7,18 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UpstoreNet(SimpleHoster):
- __name__ = "UpstoreNet"
- __type__ = "hoster"
- __version__ = "0.02"
+ __name__ = "UpstoreNet"
+ __type__ = "hoster"
+ __version__ = "0.03"
__pattern__ = r'https?://(?:www\.)?upstore\.net/'
__description__ = """Upstore.Net File Download Hoster"""
- __authors__ = [("igel", "igelkun@myopera.com")]
+ __license__ = "GPLv3"
+ __authors__ = [("igel", "igelkun@myopera.com")]
- FILE_INFO_PATTERN = r'<div class="comment">.*?</div>\s*\n<h2 style="margin:0">(?P<N>.*?)</h2>\s*\n<div class="comment">\s*\n\s*(?P<S>[\d.]+) (?P<U>\w+)'
+ INFO_PATTERN = r'<div class="comment">.*?</div>\s*\n<h2 style="margin:0">(?P<N>.*?)</h2>\s*\n<div class="comment">\s*\n\s*(?P<S>[\d.,]+) (?P<U>[\w^_]+)'
OFFLINE_PATTERN = r'<span class="error">File not found</span>'
WAIT_PATTERN = r'var sec = (\d+)'
@@ -29,7 +30,7 @@ class UpstoreNet(SimpleHoster):
# STAGE 1: get link to continue
m = re.search(self.CHASH_PATTERN, self.html)
if m is None:
- self.parseError("could not detect hash")
+ self.error(_("CHASH_PATTERN not found"))
chash = m.group(1)
self.logDebug("Read hash " + chash)
# continue to stage2
@@ -39,14 +40,12 @@ class UpstoreNet(SimpleHoster):
# STAGE 2: solv captcha and wait
# first get the infos we need: recaptcha key and wait time
recaptcha = ReCaptcha(self)
- if recaptcha.detect_key() is None:
- self.parseError("ReCaptcha key not found")
- self.logDebug("Using captcha key " + recaptcha.key)
+
# try the captcha 5 times
for i in xrange(5):
m = re.search(self.WAIT_PATTERN, self.html)
if m is None:
- self.parseError("could not find wait pattern")
+ self.error(_("Wait pattern not found"))
wait_time = m.group(1)
# then, do the waiting
@@ -60,15 +59,14 @@ class UpstoreNet(SimpleHoster):
self.html = self.load(self.pyfile.url, post=post_data, decode=True)
# STAGE 3: get direct link
- m = re.search(self.LINK_PATTERN, self.html, re.DOTALL)
+ m = re.search(self.LINK_PATTERN, self.html, re.S)
if m:
break
if m is None:
- self.parseError("could not detect direct link")
+ self.error(_("Download link not found"))
direct = m.group(1)
- self.logDebug("Found direct link: " + direct)
self.download(direct, disposition=True)