summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/UploadableCh.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/UploadableCh.py')
-rw-r--r--module/plugins/hoster/UploadableCh.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py
index f323a3538..88d79e9ba 100644
--- a/module/plugins/hoster/UploadableCh.py
+++ b/module/plugins/hoster/UploadableCh.py
@@ -2,14 +2,15 @@
import re
-from module.plugins.internal.ReCaptcha import ReCaptcha
+from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UploadableCh(SimpleHoster):
__name__ = "UploadableCh"
__type__ = "hoster"
- __version__ = "0.10"
+ __version__ = "0.12"
+ __status__ = "testing"
__pattern__ = r'http://(?:www\.)?uploadable\.ch/file/(?P<ID>\w+)'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -32,46 +33,45 @@ class UploadableCh(SimpleHoster):
RECAPTCHA_KEY = "6LdlJuwSAAAAAPJbPIoUhyqOJd7-yrah5Nhim5S3"
- def handleFree(self, pyfile):
- # Click the "free user" button and wait
- a = self.load(pyfile.url, post={'downloadLink': "wait"}, decode=True)
- self.logDebug(a)
+ def handle_free(self, pyfile):
+ #: Click the "free user" button and wait
+ a = self.load(pyfile.url, post={'downloadLink': "wait"})
+ self.log_debug(a)
self.wait(30)
- # Make the recaptcha appear and show it the pyload interface
- b = self.load(pyfile.url, post={'checkDownload': "check"}, decode=True)
- self.logDebug(b) #: Expected output: {"success":"showCaptcha"}
+ #: Make the recaptcha appear and show it the pyload interface
+ b = self.load(pyfile.url, post={'checkDownload': "check"})
+ self.log_debug(b) #: Expected output: {'success': "showCaptcha"}
recaptcha = ReCaptcha(self)
response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY)
- # Submit the captcha solution
+ #: Submit the captcha solution
self.load("http://www.uploadable.ch/checkReCaptcha.php",
post={'recaptcha_challenge_field' : challenge,
'recaptcha_response_field' : response,
- 'recaptcha_shortencode_field': self.info['pattern']['ID']},
- decode=True)
+ 'recaptcha_shortencode_field': self.info['pattern']['ID']})
self.wait(3)
- # Get ready for downloading
- self.load(pyfile.url, post={'downloadLink': "show"}, decode=True)
+ #: Get ready for downloading
+ self.load(pyfile.url, post={'downloadLink': "show"})
self.wait(3)
- # Download the file
+ #: Download the file
self.download(pyfile.url, post={'download': "normal"}, disposition=True)
- def checkFile(self, rules={}):
- if self.checkDownload({'wait': re.compile("Please wait for")}):
- self.logInfo("Downloadlimit reached, please wait or reconnect")
+ def check_file(self):
+ if self.check_download({'wait': re.compile("Please wait for")}):
+ self.log_info(_("Downloadlimit reached, please wait or reconnect"))
self.wait(60 * 60, True)
self.retry()
- return super(UploadableCh, self).checkFile(rules)
+ return super(UploadableCh, self).check_file()
getInfo = create_getInfo(UploadableCh)