diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-10 03:02:26 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-10 03:02:26 +0200 |
commit | 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 (patch) | |
tree | 703010e32f62bf869551ce0d323dacf62bc448ff /module/plugins/hoster/RemixshareCom.py | |
parent | [SimpleCrypter] Support parseError (diff) | |
download | pyload-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/RemixshareCom.py')
-rw-r--r-- | module/plugins/hoster/RemixshareCom.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/module/plugins/hoster/RemixshareCom.py b/module/plugins/hoster/RemixshareCom.py index dedb3b8e1..a0f67e0b2 100644 --- a/module/plugins/hoster/RemixshareCom.py +++ b/module/plugins/hoster/RemixshareCom.py @@ -1,11 +1,13 @@ # -*- coding: utf-8 -*- -#Testlink: -#http://remixshare.com/download/p946u -# + +# Test link: +# http://remixshare.com/download/p946u + +# Note: # The remixshare.com website is very very slow, so # if your download not starts because of pycurl timeouts: # Adjust timeouts in /usr/share/pyload/module/network/HTTPRequest.py -# + import re @@ -24,9 +26,9 @@ class RemixshareCom(SimpleHoster): FILE_INFO_PATTERN = r'title=\'.+?\'>(?P<N>.+?)</span><span class=\'light2\'> \((?P<S>\d+) (?P<U>\w+)\)<' OFFLINE_PATTERN = r'<h1>Ooops!<' - WAIT_PATTERN = r'var XYZ = "(\d+)"' - FILE_URL_PATTERN = r'(http://remixshare.com/downloadfinal/.+?)"' - FILE_TOKEN_PATTERN = r'var acc = (\d+)' + LINK_PATTERN = r'(http://remixshare\.com/downloadfinal/.+?)"' + TOKEN_PATTERN = r'var acc = (\d+)' + WAIT_PATTERN = r'var XYZ = r"(\d+)"' def setup(self): @@ -34,12 +36,12 @@ class RemixshareCom(SimpleHoster): self.chunkLimit = 1 def handleFree(self): - b = re.search(self.FILE_URL_PATTERN, self.html) + b = re.search(self.LINK_PATTERN, self.html) if not b: - self.fail("Can not parse download url") - c = re.search(self.FILE_TOKEN_PATTERN, self.html) + self.parseError("Cannot parse download url") + c = re.search(self.TOKEN_PATTERN, self.html) if not c: - self.fail("Can not parse file token") + self.parseError("Cannot parse file token") dl_url = b.group(1) + c.group(1) #Check if we have to wait @@ -49,7 +51,7 @@ class RemixshareCom(SimpleHoster): self.wait(seconds.group(1)) # Finally start downloading... - self.logDebug("Download-URL: " + dl_url) + self.logDebug("Download URL = r" + dl_url) self.download(dl_url, disposition=True) |