summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/FilecloudIo.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/FilecloudIo.py')
-rw-r--r--module/plugins/hoster/FilecloudIo.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py
index 8b6804a68..bc328ddbd 100644
--- a/module/plugins/hoster/FilecloudIo.py
+++ b/module/plugins/hoster/FilecloudIo.py
@@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FilecloudIo(SimpleHoster):
__name__ = "FilecloudIo"
__type__ = "hoster"
- __version__ = "0.05"
+ __version__ = "0.06"
__pattern__ = r'http://(?:www\.)?(?:filecloud\.io|ifile\.it|mihd\.net)/(?P<ID>\w+)'
@@ -20,17 +20,21 @@ class FilecloudIo(SimpleHoster):
("stickell", "l.stickell@yahoo.it")]
- SIZE_PATTERN = r'{var __ab1 = (?P<S>\d+);}'
- NAME_PATTERN = r'id="aliasSpan">(?P<N>.*?)&nbsp;&nbsp;<'
- OFFLINE_PATTERN = r'l10n\.(FILES__DOESNT_EXIST|REMOVED)'
+ LOGIN_ACCOUNT = True
+
+ NAME_PATTERN = r'id="aliasSpan">(?P<N>.*?)&nbsp;&nbsp;<'
+ SIZE_PATTERN = r'{var __ab1 = (?P<S>\d+);}'
+ OFFLINE_PATTERN = r'l10n\.(FILES__DOESNT_EXIST|REMOVED)'
TEMP_OFFLINE_PATTERN = r'l10n\.FILES__WARNING'
UKEY_PATTERN = r'\'ukey\'\s*:\'(\w+)'
- AB1_PATTERN = r'if\( __ab1 == \'(\w+)\' \)'
+ AB1_PATTERN = r'if\( __ab1 == \'(\w+)\' \)'
+
ERROR_MSG_PATTERN = r'var __error_msg\s*=\s*l10n\.(.*?);'
+
RECAPTCHA_PATTERN = r'var __recaptcha_public\s*=\s*\'(.+?)\';'
- LINK_PATTERN = r'"(http://s\d+\.filecloud\.io/%s/\d+/.*?)"'
+ LINK_FREE_PATTERN = r'"(http://s\d+\.filecloud\.io/%s/\d+/.*?)"'
def setup(self):
@@ -39,7 +43,7 @@ class FilecloudIo(SimpleHoster):
self.chunkLimit = 1
- def handleFree(self):
+ def handleFree(self, pyfile):
data = {"ukey": self.info['pattern']['ID']}
m = re.search(self.AB1_PATTERN, self.html)
@@ -55,14 +59,11 @@ class FilecloudIo(SimpleHoster):
if captcha_key is None:
self.error(_("ReCaptcha key not found"))
- if not self.account:
- self.fail(_("User not logged in"))
- elif not self.account.logged_in:
- challenge, response = recaptcha.challenge(captcha_key)
- self.account.form_data = {"recaptcha_challenge_field": challenge,
- "recaptcha_response_field" : response}
- self.account.relogin(self.user)
- self.retry(2)
+ challenge, response = recaptcha.challenge(captcha_key)
+ self.account.form_data = {"recaptcha_challenge_field": challenge,
+ "recaptcha_response_field" : response}
+ self.account.relogin(self.user)
+ self.retry(2)
json_url = "http://filecloud.io/download-request.json"
res = self.load(json_url, post=data)
@@ -95,9 +96,9 @@ class FilecloudIo(SimpleHoster):
if res['dl']:
self.html = self.load('http://filecloud.io/download.html')
- m = re.search(self.LINK_PATTERN % self.info['pattern']['ID'], self.html)
+ m = re.search(self.LINK_FREE_PATTERN % self.info['pattern']['ID'], self.html)
if m is None:
- self.error(_("LINK_PATTERN not found"))
+ self.error(_("LINK_FREE_PATTERN not found"))
if "size" in self.info and self.info['size']:
self.check_data = {"size": int(self.info['size'])}
@@ -108,7 +109,7 @@ class FilecloudIo(SimpleHoster):
self.fail(_("Unexpected server response"))
- def handlePremium(self):
+ def handlePremium(self, pyfile):
akey = self.account.getAccountData(self.user)['akey']
ukey = self.info['pattern']['ID']
self.logDebug("Akey: %s | Ukey: %s" % (akey, ukey))