summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/UpstoreNet.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/hoster/UpstoreNet.py
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/Account.py module/plugins/AccountManager.py module/plugins/Hook.py module/plugins/OCR.py module/plugins/Plugin.py module/plugins/PluginManager.py module/plugins/ReCaptcha.py module/plugins/accounts/Ftp.py module/plugins/accounts/Http.py module/plugins/internal/MultiHoster.py module/plugins/ocr/GigasizeCom.py module/plugins/ocr/LinksaveIn.py module/plugins/ocr/NetloadIn.py module/plugins/ocr/ShareonlineBiz.py
Diffstat (limited to 'module/plugins/hoster/UpstoreNet.py')
-rw-r--r--module/plugins/hoster/UpstoreNet.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py
index 9d1c4b3dd..140024731 100644
--- a/module/plugins/hoster/UpstoreNet.py
+++ b/module/plugins/hoster/UpstoreNet.py
@@ -1,29 +1,34 @@
# -*- coding: utf-8 -*-
+
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UpstoreNet(SimpleHoster):
__name__ = "UpstoreNet"
__type__ = "hoster"
- __pattern__ = r"https?://(?:www\.)?upstore\.net/"
__version__ = "0.02"
+
+ __pattern__ = r'https?://(?:www\.)?upstore\.net/'
+
__description__ = """Upstore.Net File Download Hoster"""
- __author_name__ = ("igel")
+ __author_name__ = "igel"
+ __author_mail__ = "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+)'
- FILE_OFFLINE_PATTERN = r'<span class="error">File not found</span>'
+ OFFLINE_PATTERN = r'<span class="error">File not found</span>'
- WAIT_PATTERN = r"var sec = (\d+)"
+ WAIT_PATTERN = r'var sec = (\d+)'
CHASH_PATTERN = r'<input type="hidden" name="hash" value="([^"]*)">'
- DIRECT_LINK_PATTERN = r'<a href="(https?://.*?)" target="_blank"><b>'
+ LINK_PATTERN = r'<a href="(https?://.*?)" target="_blank"><b>'
+
def handleFree(self):
# STAGE 1: get link to continue
m = re.search(self.CHASH_PATTERN, self.html)
- if not m:
+ if m is None:
self.parseError("could not detect hash")
chash = m.group(1)
self.logDebug("read hash " + chash)
@@ -40,7 +45,7 @@ class UpstoreNet(SimpleHoster):
# try the captcha 5 times
for i in xrange(5):
m = re.search(self.WAIT_PATTERN, self.html)
- if not m:
+ if m is None:
self.parseError("could not find wait pattern")
wait_time = m.group(1)
@@ -55,11 +60,11 @@ class UpstoreNet(SimpleHoster):
self.html = self.load(self.pyfile.url, post=post_data, decode=True)
# STAGE 3: get direct link
- m = re.search(self.DIRECT_LINK_PATTERN, self.html, re.DOTALL)
+ m = re.search(self.LINK_PATTERN, self.html, re.DOTALL)
if m:
break
- if not m:
+ if m is None:
self.parseError("could not detect direct link")
direct = m.group(1)