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.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py
index e28944ab9..283359927 100644
--- a/module/plugins/hoster/UploadableCh.py
+++ b/module/plugins/hoster/UploadableCh.py
@@ -2,18 +2,17 @@
import re
-from time import sleep
-
-from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UploadableCh(SimpleHoster):
__name__ = "UploadableCh"
__type__ = "hoster"
- __version__ = "0.06"
+ __version__ = "0.11"
__pattern__ = r'http://(?:www\.)?uploadable\.ch/file/(?P<ID>\w+)'
+ __config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """Uploadable.ch hoster plugin"""
__license__ = "GPLv3"
@@ -21,9 +20,9 @@ class UploadableCh(SimpleHoster):
("Walter Purcaro", "vuolter@gmail.com")]
- FILE_URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://www.uploadable.ch/file/\g<ID>')]
+ URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://www.uploadable.ch/file/\g<ID>')]
- FILE_INFO_PATTERN = r'div id=\"file_name\" title=.*>(?P<N>.+)<span class=\"filename_normal\">\((?P<S>[\d.]+) (?P<U>\w+)\)</span><'
+ INFO_PATTERN = r'div id=\"file_name\" title=.*>(?P<N>.+)<span class=\"filename_normal\">\((?P<S>[\d.]+) (?P<U>\w+)\)</span><'
OFFLINE_PATTERN = r'>(File not available|This file is no longer available)'
TEMP_OFFLINE_PATTERN = r'<div class="icon_err">'
@@ -35,22 +34,21 @@ class UploadableCh(SimpleHoster):
def handleFree(self, pyfile):
# Click the "free user" button and wait
- a = self.load(pyfile.url, cookies=True, post={'downloadLink': "wait"}, decode=True)
+ a = self.load(pyfile.url, post={'downloadLink': "wait"}, decode=True)
self.logDebug(a)
self.wait(30)
# Make the recaptcha appear and show it the pyload interface
- b = self.load(pyfile.url, cookies=True, post={'checkDownload': "check"}, decode=True)
+ b = self.load(pyfile.url, post={'checkDownload': "check"}, decode=True)
self.logDebug(b) #: Expected output: {"success":"showCaptcha"}
recaptcha = ReCaptcha(self)
- challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
+ response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY)
# Submit the captcha solution
self.load("http://www.uploadable.ch/checkReCaptcha.php",
- cookies=True,
post={'recaptcha_challenge_field' : challenge,
'recaptcha_response_field' : response,
'recaptcha_shortencode_field': self.info['pattern']['ID']},
@@ -59,12 +57,12 @@ class UploadableCh(SimpleHoster):
self.wait(3)
# Get ready for downloading
- self.load(pyfile.url, cookies=True, post={'downloadLink': "show"}, decode=True)
+ self.load(pyfile.url, post={'downloadLink': "show"}, decode=True)
self.wait(3)
# Download the file
- self.download(pyfile.url, cookies=True, post={'download': "normal"}, disposition=True)
+ self.download(pyfile.url, post={'download': "normal"}, disposition=True)
def checkFile(self):